22 #ifndef FIFE_VIDEO_RENDERBACKENSD_OPENGL_RENDERBACKENDOPENGL_H 23 #define FIFE_VIDEO_RENDERBACKENSD_OPENGL_RENDERBACKENDOPENGL_H 47 virtual const std::string&
getName()
const;
50 virtual void init(
const std::string& driver);
54 virtual void setLighting(
float red,
float green,
float blue);
251 const void* tex_pointer[4];
Abstract interface for all the renderbackends.
virtual void setScreenMode(const ScreenMode &mode)
Sets the mainscreen display mode.
std::vector< RenderZObjectTest > m_renderZ_objects
void renderWithMultitextureAndZ()
virtual void setLighting(float red, float green, float blue)
Set colors for lighting.
virtual void drawFillCircleSegment(const Point &p, uint32_t radius, int32_t sangle, int32_t eangle, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a filled circle segment.
virtual void fillRectangle(const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a filled axis parallel rectangle.
GLint vertex_pointer_size
virtual void renderGuiGeometry(const std::vector< GuiVertex > &vertices, const std::vector< int > &indices, const DoublePoint &translation, ImagePtr texture)
Renders geometry required by gui.
uint8_t getStencilRef() const
virtual void drawFillCircle(const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a filled circle.
std::vector< renderDataP > m_renderPrimitiveDatas
std::vector< renderDataZ > m_renderForcedDatasZ
virtual void renderVertexArrays()
Render the Vertex Arrays, only for primitives (points, lines,...)
std::vector< RenderObject > m_renderMultitextureObjectsZ
std::vector< renderDataColorZ > m_renderTextureColorDatasZ
void disableTextures(uint32_t texUnit)
virtual const std::string & getName() const
The name of the renderbackend.
std::vector< RenderObject > m_renderForcedObjectsZ
virtual void init(const std::string &driver)
Initializes the backend.
virtual bool putPixel(int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Writes pixel to given position.
std::vector< renderData2TC > m_renderMultitextureDatas
virtual void drawQuad(const Point &p1, const Point &p2, const Point &p3, const Point &p4, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws quad between given points with given RGBA.
std::vector< uint32_t > m_tc2Indices
virtual void drawTriangle(const Point &p1, const Point &p2, const Point &p3, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws triangle between given points with given RGBA.
void prepareForOverlays()
virtual void drawLine(const Point &p1, const Point &p2, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws line between given points with given RGBA.
virtual void setClipArea(const Rect &cliparea, bool clear)
Sets given clip area into image.
virtual void drawVertex(const Point &p, const uint8_t size, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a quad that represents a vertex with given RGBA.
void setStencilTest(uint8_t stencil_ref, GLenum stencil_op, GLenum stencil_func)
void enableTextures(uint32_t texUnit)
std::vector< uint32_t > m_indices
static indices for vertex data with z
virtual void addImageToArray(uint32_t id, const Rect &rec, float const *st, uint8_t alpha, uint8_t const *rgba)
Add the Image data to the array.
void setVertexPointer(GLint size, GLsizei stride, const GLvoid *ptr)
virtual void drawCircleSegment(const Point &p, uint32_t radius, int32_t sangle, int32_t eangle, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a circle segment.
virtual void setLightingModel(uint32_t lighting)
Initializes the light.
virtual Image * createImage(IResourceLoader *loader=0)
std::vector< uint32_t > m_pIndices
virtual void resetLighting()
Reset lighting with default values.
virtual void disableScissorTest()
Disables scissor test on the render backend.
virtual void drawCircle(const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws a circle.
virtual void captureScreen(const std::string &filename)
Creates a Screenshot and saves it to a file.
std::vector< renderDataT > m_renderTextureDatas
virtual uint32_t getLightingModel() const
Gets the current light model.
virtual void drawThickLine(const Point &p1, const Point &p2, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws line between given points with given RGBA and width.
virtual void clearBackBuffer()
Forces a clear of the backbuffer.
virtual ~RenderBackendOpenGL()
virtual void changeBlending(int32_t scr, int32_t dst)
Change the Blendingmodel.
virtual void drawBezier(const std::vector< Point > &points, int32_t steps, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws bezier curve between given points with given RGBA and width.
struct FIFE::RenderBackendOpenGL::currentState m_state
uint32_t active_client_tex
virtual void changeRenderInfos(RenderDataType type, uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc, OverlayType otype=OVERLAY_TYPE_NONE)
Dirty helper function to change the render infos.
virtual void drawPolyLine(const std::vector< Point > &points, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws lines between given points with given RGBA and width.
virtual void detachRenderTarget()
Detaches current render surface.
void setTexCoordPointer(uint32_t texUnit, GLsizei stride, const GLvoid *ptr)
std::vector< renderDataZ > m_renderZ_datas
const void * vertex_pointer
std::vector< renderDataTC > m_renderTextureColorDatas
const void * color_pointer
void renderWithColorAndZ()
std::vector< renderData2TCZ > m_renderMultitextureDatasZ
void setAlphaTest(float ref_alpha)
virtual void createMainScreen(const ScreenMode &mode, const std::string &title, const std::string &icon)
Creates the mainscreen (the display window).
std::vector< renderDataZ > m_renderTextureDatasZ
std::vector< RenderObject > m_renderObjects
RenderZObjectTest * getRenderBufferObject(GLuint texture_id)
void disableStencilTest()
RenderBackendOpenGL(const SDL_Color &colorkey)
void setEnvironmentalColor(uint32_t texUnit, const uint8_t *rgba)
void setColorPointer(GLsizei stride, const GLvoid *ptr)
virtual void drawRectangle(const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Draws an axis parallel rectangle.
std::vector< RenderZObject > m_renderTextureColorObjectsZ
virtual void drawLightPrimitive(const Point &p, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue)
Draws a light primitive that based on a triangle fan.
virtual void addImageToArrayZ(uint32_t id, const Rect &rect, float vertexZ, float const *st, uint8_t alpha, uint8_t const *rgba)
virtual void attachRenderTarget(ImagePtr &img, bool discard)
Attaches given image as a new render surface.
std::vector< RenderZObject > m_renderTextureObjectsZ
virtual void startFrame()
Called when a new frame starts.
std::vector< uint32_t > m_tcIndices
std::vector< uint32_t > m_tIndices
virtual void enableScissorTest()
Enables scissor test on the render backend.
The main class of the OpenGL-based renderer.
void bindTexture(uint32_t texUnit, GLuint texId)
virtual void endFrame()
Called when a frame is finished and ready to be displayed.
virtual void resetStencilBuffer(uint8_t buffer)
Reset stencil buffer with given value.