FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::RenderBackendOpenGL Class Reference

The main class of the OpenGL-based renderer. More...

#include <renderbackendopengl.h>

+ Inheritance diagram for FIFE::RenderBackendOpenGL:
+ Collaboration diagram for FIFE::RenderBackendOpenGL:

Classes

struct  currentState
 
struct  renderData
 
struct  renderData2T
 
class  RenderObject
 

Public Member Functions

 RenderBackendOpenGL (const SDL_Color &colorkey)
 
virtual ~RenderBackendOpenGL ()
 
virtual const std::string & getName () const
 The name of the renderbackend. More...
 
virtual void startFrame ()
 Called when a new frame starts. More...
 
virtual void endFrame ()
 Called when a frame is finished and ready to be displayed. More...
 
virtual void init (const std::string &driver)
 Initializes the backend. More...
 
virtual void clearBackBuffer ()
 Forces a clear of the backbuffer. More...
 
virtual void setLightingModel (uint32_t lighting)
 Initializes the light. More...
 
virtual uint32_t getLightingModel () const
 Gets the current light model. More...
 
virtual void setLighting (float red, float green, float blue)
 Set colors for lighting. More...
 
virtual void resetLighting ()
 Reset lighting with default values. More...
 
virtual void resetStencilBuffer (uint8_t buffer)
 Reset stencil buffer with given value. More...
 
virtual void changeBlending (int32_t scr, int32_t dst)
 Change the Blendingmodel. More...
 
virtual void createMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon)
 Creates the mainscreen (the display window). More...
 
virtual void setScreenMode (const ScreenMode &mode)
 Sets the mainscreen display mode. More...
 
virtual ImagecreateImage (IResourceLoader *loader=0)
 
virtual ImagecreateImage (const std::string &name, IResourceLoader *loader=0)
 
virtual ImagecreateImage (const uint8_t *data, uint32_t width, uint32_t height)
 Creates an Image suitable for this renderbackend. More...
 
virtual ImagecreateImage (const std::string &name, const uint8_t *data, uint32_t width, uint32_t height)
 
virtual ImagecreateImage (SDL_Surface *surface)
 Helper function to create images from SDL_Surfaces. More...
 
virtual ImagecreateImage (const std::string &name, SDL_Surface *surface)
 
virtual void renderVertexArrays ()
 Render the Vertex Arrays, only for primitives (points, lines,...) More...
 
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. More...
 
virtual void changeRenderInfos (uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc)
 Dirty helper function to change the render infos. More...
 
virtual void captureScreen (const std::string &filename)
 Creates a Screenshot and saves it to a file. More...
 
virtual void captureScreen (const std::string &filename, uint32_t width, uint32_t height)
 Creates a Screenshot with the given size(w,h) and saves it to a file. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void attachRenderTarget (ImagePtr &img, bool discard)
 Attaches given image as a new render surface. More...
 
virtual void detachRenderTarget ()
 Detaches current render surface. More...
 
void enableTextures (uint32_t texUnit)
 
void disableTextures (uint32_t texUnit)
 
void bindTexture (uint32_t texUnit, GLuint texId)
 
void bindTexture (GLuint textId)
 
- Public Member Functions inherited from FIFE::RenderBackend
 RenderBackend (const SDL_Color &colorkey)
 Constructor. More...
 
virtual ~RenderBackend ()
 Destructor. More...
 
void deinit ()
 Performs cleanup actions. More...
 
const ScreenModegetCurrentScreenMode () const
 Get current screen mode. More...
 
uint32_t getWidth () const
 
uint32_t getHeight () const
 
uint32_t getScreenWidth () const
 
uint32_t getScreenHeight () const
 
const RectgetArea () const
 
void pushClipArea (const Rect &cliparea, bool clear=true)
 Pushes clip area to clip stack Clip areas define which area is drawn on screen. More...
 
void popClipArea ()
 Pops clip area from clip stack. More...
 
const RectgetClipArea () const
 Gets the current clip area. More...
 
void setAlphaOptimizerEnabled (bool enabled)
 Enable or disable the alpha 'optimizing' code. More...
 
bool isAlphaOptimizerEnabled () const
 
void setImageCompressingEnabled (bool enabled)
 Enables or disable compressing images by video driver. More...
 
bool isImageCompressingEnabled () const
 
void setFramebufferEnabled (bool enabled)
 Enables or disable the usage of the framebuffer, if available. More...
 
bool isFramebufferEnabled () const
 
void setNPOTEnabled (bool enabled)
 Enables or disable the usage of npot, if available. More...
 
bool isNPOTEnabled () const
 
void setColorKeyEnabled (bool colorkeyenable)
 Sets whether to use the colorkey feature. More...
 
bool isColorKeyEnabled () const
 Gets whether the colorkey feature is in use. More...
 
void setColorKey (const SDL_Color &colorkey)
 Sets the global colorkey to use for images. More...
 
const SDL_Color & getColorKey () const
 Gets the global colorkey setting. More...
 
void setBackgroundColor (uint8_t r, uint8_t g, uint8_t b)
 Set the background color. More...
 
void resetBackgroundColor ()
 Reset the background color to black. More...
 
const SDL_PixelFormat & getPixelFormat () const
 Gets the current screen rgba format. More...
 
void setFrameLimitEnabled (bool limited)
 Sets whether to use the frame limiter. More...
 
bool isFrameLimitEnabled () const
 Gets whether the frame limiter is in use. More...
 
void setFrameLimit (uint16_t framelimit)
 Sets the frame limit. More...
 
uint16_t getFrameLimit () const
 Gets the frame limit. More...
 
SDL_Surface * getRenderTargetSurface ()
 Returns currently attached render surface. More...
 
- Public Member Functions inherited from FIFE::DynamicSingleton< RenderBackend >
 DynamicSingleton ()
 
virtual ~DynamicSingleton ()
 

Protected Member Functions

virtual void setClipArea (const Rect &cliparea, bool clear)
 Sets given clip area into image. More...
 
void enableLighting ()
 
void disableLighting ()
 
void enableStencilTest ()
 
void disableStencilTest ()
 
void setStencilTest (uint8_t stencil_ref, GLenum stencil_op, GLenum stencil_func)
 
uint8_t getStencilRef () const
 
void enableAlphaTest ()
 
void disableAlphaTest ()
 
void setAlphaTest (float ref_alpha)
 
void setEnvironmentalColor (const uint8_t *rgba)
 
void setVertexPointer (GLsizei stride, const GLvoid *ptr)
 
void setColorPointer (GLsizei stride, const GLvoid *ptr)
 
void setTexCoordPointer (uint32_t texUnit, GLsizei stride, const GLvoid *ptr)
 
void enableScissorTest ()
 
void disableScissorTest ()
 
void prepareForOverlays ()
 
- Protected Member Functions inherited from FIFE::RenderBackend
void clearClipArea ()
 Clears any possible clip areas. More...
 

Protected Attributes

GLuint m_mask_overlays
 
std::vector< renderDatam_render_datas
 
std::vector< renderData2Tm_render_datas2T
 
std::vector< RenderObjectm_render_objects
 
struct
FIFE::RenderBackendOpenGL::currentState 
m_state
 
GLuint m_fbo_id
 
ImagePtr m_img_target
 
bool m_target_discard
 
- Protected Attributes inherited from FIFE::RenderBackend
SDL_Surface * m_screen
 
SDL_Surface * m_target
 
bool m_compressimages
 
bool m_useframebuffer
 
bool m_usenpot
 
bool m_isalphaoptimized
 
bool m_iscolorkeyenabled
 
SDL_Color m_colorkey
 
ScreenMode m_screenMode
 
SDL_PixelFormat m_rgba_format
 
bool m_isbackgroundcolor
 
SDL_Color m_backgroundcolor
 
std::stack< ClipInfom_clipstack
 

Additional Inherited Members

- Static Public Member Functions inherited from FIFE::DynamicSingleton< RenderBackend >
static RenderBackendinstance ()
 

Detailed Description

The main class of the OpenGL-based renderer.

See Also
RenderBackend

Definition at line 43 of file renderbackendopengl.h.

Constructor & Destructor Documentation

FIFE::RenderBackendOpenGL::~RenderBackendOpenGL ( )
virtual

Member Function Documentation

void FIFE::RenderBackendOpenGL::bindTexture ( uint32_t  texUnit,
GLuint  texId 
)
void FIFE::RenderBackendOpenGL::bindTexture ( GLuint  textId)
void FIFE::RenderBackendOpenGL::captureScreen ( const std::string &  filename)
virtual

Creates a Screenshot and saves it to a file.

Implements FIFE::RenderBackend.

Definition at line 1104 of file renderbackendopengl.cpp.

References FIFE::BMASK, FIFE::RenderBackend::getHeight(), FIFE::RenderBackend::getWidth(), FIFE::GMASK, FIFE::NULLMASK, FIFE::RMASK, and FIFE::Image::saveAsPng().

Referenced by captureScreen().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::captureScreen ( const std::string &  filename,
uint32_t  width,
uint32_t  height 
)
virtual

Creates a Screenshot with the given size(w,h) and saves it to a file.

Implements FIFE::RenderBackend.

Definition at line 1138 of file renderbackendopengl.cpp.

References FIFE::AMASK, FIFE::BMASK, captureScreen(), FIFE::RenderBackend::getHeight(), FIFE::RenderBackend::getWidth(), FIFE::GMASK, FIFE::RMASK, and FIFE::Image::saveAsPng().

void FIFE::RenderBackendOpenGL::changeBlending ( int32_t  scr,
int32_t  dst 
)
virtual

Change the Blendingmodel.

Implements FIFE::RenderBackend.

Definition at line 537 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::blend_dst, FIFE::RenderBackendOpenGL::currentState::blend_src, and m_state.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::changeRenderInfos ( uint16_t  elements,
int32_t  src,
int32_t  dst,
bool  light,
bool  stentest,
uint8_t  stenref,
GLConstants  stenop,
GLConstants  stenfunc 
)
virtual
void FIFE::RenderBackendOpenGL::clearBackBuffer ( )
virtual

Forces a clear of the backbuffer.

Implements FIFE::RenderBackend.

Definition at line 131 of file renderbackendopengl.cpp.

References disableScissorTest(), and enableScissorTest().

Image * FIFE::RenderBackendOpenGL::createImage ( IResourceLoader loader = 0)
virtual

Implements FIFE::RenderBackend.

Definition at line 235 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::createImage ( const std::string &  name,
IResourceLoader loader = 0 
)
virtual

Implements FIFE::RenderBackend.

Definition at line 239 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::createImage ( const uint8_t *  data,
uint32_t  width,
uint32_t  height 
)
virtual

Creates an Image suitable for this renderbackend.

Parameters
dataPointer to the imagedata (needs to be in RGBA, 8 bits per channel).
widthWidth of the image.
heightHeight of the image.
Returns
The new Image.

Implements FIFE::RenderBackend.

Definition at line 313 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::createImage ( const std::string &  name,
const uint8_t *  data,
uint32_t  width,
uint32_t  height 
)
virtual

Implements FIFE::RenderBackend.

Definition at line 317 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::createImage ( SDL_Surface *  surface)
virtual

Helper function to create images from SDL_Surfaces.

Takes ownership over the surface.

Parameters
surfaceThe surface to convert.
Returns
The new Image.

Implements FIFE::RenderBackend.

Definition at line 243 of file renderbackendopengl.cpp.

References FIFE::RenderBackend::m_rgba_format.

Image * FIFE::RenderBackendOpenGL::createImage ( const std::string &  name,
SDL_Surface *  surface 
)
virtual

Implements FIFE::RenderBackend.

Definition at line 278 of file renderbackendopengl.cpp.

References FIFE::RenderBackend::m_rgba_format.

void FIFE::RenderBackendOpenGL::createMainScreen ( const ScreenMode mode,
const std::string &  title,
const std::string &  icon 
)
virtual

Creates the mainscreen (the display window).

Parameters
modeThe ScreenMode to use.
See Also
FIFE::ScreenMode.
Parameters
titleThe window title to use.
iconThe window icon to use.

Implements FIFE::RenderBackend.

Definition at line 137 of file renderbackendopengl.cpp.

References setScreenMode().

void FIFE::RenderBackendOpenGL::disableAlphaTest ( )
protected

Definition at line 467 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::alpha_enabled, and m_state.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::disableLighting ( )
protected

Definition at line 398 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::light_enabled, FIFE::RenderBackendOpenGL::currentState::lightmodel, and m_state.

Referenced by renderVertexArrays(), and setLightingModel().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::disableScissorTest ( )
protected

Definition at line 530 of file renderbackendopengl.cpp.

References m_state, and FIFE::RenderBackendOpenGL::currentState::scissor_test.

Referenced by clearBackBuffer(), and resetStencilBuffer().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::disableStencilTest ( )
protected

Definition at line 425 of file renderbackendopengl.cpp.

References m_state, and FIFE::RenderBackendOpenGL::currentState::sten_enabled.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::disableTextures ( uint32_t  texUnit)

Definition at line 355 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::active_tex, m_state, and FIFE::RenderBackendOpenGL::currentState::tex_enabled.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::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 
)
virtual
void FIFE::RenderBackendOpenGL::drawLine ( const Point p1,
const Point p2,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual

Draws line between given points with given RGBA.

Implements FIFE::RenderBackend.

Definition at line 815 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::renderData::color, m_render_datas, m_render_objects, FIFE::RenderBackendOpenGL::renderData::vertex, FIFE::PointType2D< T >::x, and FIFE::PointType2D< T >::y.

Referenced by FIFE::OpenGLGuiGraphics::drawLine().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::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 
)
virtual
void FIFE::RenderBackendOpenGL::drawRectangle ( const Point p,
uint16_t  w,
uint16_t  h,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual
void FIFE::RenderBackendOpenGL::drawTriangle ( const Point p1,
const Point p2,
const Point p3,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual
void FIFE::RenderBackendOpenGL::drawVertex ( const Point p,
const uint8_t  size,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual
void FIFE::RenderBackendOpenGL::enableAlphaTest ( )
protected

Definition at line 460 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::alpha_enabled, and m_state.

Referenced by setAlphaTest().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::enableLighting ( )
protected

Definition at line 391 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::light_enabled, FIFE::RenderBackendOpenGL::currentState::lightmodel, and m_state.

Referenced by renderVertexArrays(), and setLightingModel().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::enableScissorTest ( )
protected

Definition at line 523 of file renderbackendopengl.cpp.

References m_state, and FIFE::RenderBackendOpenGL::currentState::scissor_test.

Referenced by clearBackBuffer(), and resetStencilBuffer().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::enableStencilTest ( )
protected

Definition at line 418 of file renderbackendopengl.cpp.

References m_state, and FIFE::RenderBackendOpenGL::currentState::sten_enabled.

Referenced by setStencilTest().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::enableTextures ( uint32_t  texUnit)

Definition at line 340 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::active_tex, m_state, and FIFE::RenderBackendOpenGL::currentState::tex_enabled.

Referenced by bindTexture(), and renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::endFrame ( )
virtual

Called when a frame is finished and ready to be displayed.

Reimplemented from FIFE::RenderBackend.

Definition at line 230 of file renderbackendopengl.cpp.

References FIFE::RenderBackend::endFrame().

void FIFE::RenderBackendOpenGL::fillRectangle ( const Point p,
uint16_t  w,
uint16_t  h,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual

Draws a filled axis parallel rectangle.

Implements FIFE::RenderBackend.

Definition at line 877 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::renderData::color, m_render_datas, m_render_objects, FIFE::RenderBackendOpenGL::renderData::vertex, FIFE::PointType2D< T >::x, and FIFE::PointType2D< T >::y.

Referenced by FIFE::OpenGLGuiGraphics::fillRectangle().

+ Here is the caller graph for this function:

uint32_t FIFE::RenderBackendOpenGL::getLightingModel ( ) const
virtual

Gets the current light model.

Implements FIFE::RenderBackend.

Definition at line 336 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::lightmodel, and m_state.

const std::string & FIFE::RenderBackendOpenGL::getName ( ) const
virtual

The name of the renderbackend.

Returns
The name of this renderbackend.

Implements FIFE::RenderBackend.

Definition at line 115 of file renderbackendopengl.cpp.

uint8_t FIFE::RenderBackendOpenGL::getStencilRef ( ) const
protected
void FIFE::RenderBackendOpenGL::init ( const std::string &  driver)
virtual

Initializes the backend.

Implements FIFE::RenderBackend.

Definition at line 120 of file renderbackendopengl.cpp.

void FIFE::RenderBackendOpenGL::prepareForOverlays ( )
protected

Definition at line 1050 of file renderbackendopengl.cpp.

References m_mask_overlays, m_state, and FIFE::RenderBackendOpenGL::currentState::texture.

Referenced by setScreenMode().

+ Here is the caller graph for this function:

bool FIFE::RenderBackendOpenGL::putPixel ( int32_t  x,
int32_t  y,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
virtual

Writes pixel to given position.

Returns true, if pixel was written (not out of bounds)

Implements FIFE::RenderBackend.

Definition at line 795 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::renderData::color, m_render_datas, m_render_objects, FIFE::RenderBackend::m_target, and FIFE::RenderBackendOpenGL::renderData::vertex.

Referenced by FIFE::OpenGLGuiGraphics::drawLine(), and FIFE::OpenGLGuiGraphics::drawPoint().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::renderVertexArrays ( )
virtual

Render the Vertex Arrays, only for primitives (points, lines,...)

Implements FIFE::RenderBackend.

Definition at line 595 of file renderbackendopengl.cpp.

References bindTexture(), changeBlending(), disableAlphaTest(), disableLighting(), disableStencilTest(), disableTextures(), FIFE::RenderBackendOpenGL::RenderObject::dst, enableLighting(), enableTextures(), FIFE::RenderBackendOpenGL::RenderObject::light, FIFE::RenderBackendOpenGL::currentState::light_enabled, FIFE::RenderBackendOpenGL::currentState::lightmodel, m_render_datas, m_render_datas2T, m_render_objects, m_state, FIFE::RenderBackendOpenGL::RenderObject::mode, FIFE::RenderBackendOpenGL::RenderObject::multitextured, FIFE::RenderBackendOpenGL::RenderObject::rgba, setAlphaTest(), setColorPointer(), setEnvironmentalColor(), setStencilTest(), setTexCoordPointer(), setVertexPointer(), FIFE::RenderBackendOpenGL::RenderObject::size, FIFE::RenderBackendOpenGL::RenderObject::src, FIFE::RenderBackendOpenGL::currentState::sten_enabled, FIFE::RenderBackendOpenGL::currentState::sten_func, FIFE::RenderBackendOpenGL::currentState::sten_op, FIFE::RenderBackendOpenGL::currentState::sten_ref, FIFE::RenderBackendOpenGL::RenderObject::stencil_func, FIFE::RenderBackendOpenGL::RenderObject::stencil_op, FIFE::RenderBackendOpenGL::RenderObject::stencil_ref, FIFE::RenderBackendOpenGL::RenderObject::stencil_test, and FIFE::RenderBackendOpenGL::RenderObject::texture_id.

Referenced by FIFE::OpenGLGuiGraphics::_endDraw(), attachRenderTarget(), detachRenderTarget(), FIFE::OpenGLGuiGraphics::popClipArea(), and FIFE::OpenGLGuiGraphics::pushClipArea().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::resetLighting ( )
virtual

Reset lighting with default values.

Implements FIFE::RenderBackend.

Definition at line 412 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::lightmodel, m_state, and setLighting().

void FIFE::RenderBackendOpenGL::resetStencilBuffer ( uint8_t  buffer)
virtual

Reset stencil buffer with given value.

Implements FIFE::RenderBackend.

Definition at line 446 of file renderbackendopengl.cpp.

References disableScissorTest(), enableScissorTest(), m_state, and FIFE::RenderBackendOpenGL::currentState::sten_buf.

void FIFE::RenderBackendOpenGL::setAlphaTest ( float  ref_alpha)
protected

Definition at line 474 of file renderbackendopengl.cpp.

References enableAlphaTest().

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setClipArea ( const Rect cliparea,
bool  clear 
)
protectedvirtual
void FIFE::RenderBackendOpenGL::setColorPointer ( GLsizei  stride,
const GLvoid *  ptr 
)
protected

Definition at line 505 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::color_pointer, and m_state.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setEnvironmentalColor ( const uint8_t *  rgba)
protected

Definition at line 479 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::active_tex, FIFE::RenderBackendOpenGL::currentState::env_color, and m_state.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setLighting ( float  red,
float  green,
float  blue 
)
virtual

Set colors for lighting.

Implements FIFE::RenderBackend.

Definition at line 405 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::lightmodel, and m_state.

Referenced by resetLighting().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setLightingModel ( uint32_t  lighting)
virtual
void FIFE::RenderBackendOpenGL::setScreenMode ( const ScreenMode mode)
virtual
void FIFE::RenderBackendOpenGL::setStencilTest ( uint8_t  stencil_ref,
GLenum  stencil_op,
GLenum  stencil_func 
)
protected
void FIFE::RenderBackendOpenGL::setTexCoordPointer ( uint32_t  texUnit,
GLsizei  stride,
const GLvoid *  ptr 
)
protected

Definition at line 512 of file renderbackendopengl.cpp.

References FIFE::RenderBackendOpenGL::currentState::active_client_tex, m_state, and FIFE::RenderBackendOpenGL::currentState::tex_pointer.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setVertexPointer ( GLsizei  stride,
const GLvoid *  ptr 
)
protected

Definition at line 498 of file renderbackendopengl.cpp.

References m_state, and FIFE::RenderBackendOpenGL::currentState::vertex_pointer.

Referenced by renderVertexArrays().

+ Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::startFrame ( )
virtual

Called when a new frame starts.

Reimplemented from FIFE::RenderBackend.

Definition at line 226 of file renderbackendopengl.cpp.

References FIFE::RenderBackend::startFrame().

Member Data Documentation

GLuint FIFE::RenderBackendOpenGL::m_fbo_id
protected

Definition at line 163 of file renderbackendopengl.h.

Referenced by attachRenderTarget(), setScreenMode(), and ~RenderBackendOpenGL().

ImagePtr FIFE::RenderBackendOpenGL::m_img_target
protected

Definition at line 164 of file renderbackendopengl.h.

Referenced by attachRenderTarget(), and detachRenderTarget().

GLuint FIFE::RenderBackendOpenGL::m_mask_overlays
protected

Definition at line 111 of file renderbackendopengl.h.

Referenced by prepareForOverlays(), and ~RenderBackendOpenGL().

std::vector<renderData> FIFE::RenderBackendOpenGL::m_render_datas
protected
std::vector<renderData2T> FIFE::RenderBackendOpenGL::m_render_datas2T
protected

Definition at line 129 of file renderbackendopengl.h.

Referenced by addImageToArray(), and renderVertexArrays().

std::vector<RenderObject> FIFE::RenderBackendOpenGL::m_render_objects
protected
bool FIFE::RenderBackendOpenGL::m_target_discard
protected

Definition at line 165 of file renderbackendopengl.h.

Referenced by attachRenderTarget().


The documentation for this class was generated from the following files: