FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::RenderBackend Class Referenceabstract

Abstract interface for all the renderbackends. More...

#include <renderbackend.h>

+ Inheritance diagram for FIFE::RenderBackend:
+ Collaboration diagram for FIFE::RenderBackend:

Classes

class  ClipInfo
 

Public Member Functions

 RenderBackend (const SDL_Color &colorkey)
 Constructor. More...
 
virtual ~RenderBackend ()
 Destructor. More...
 
virtual const std::string & getName () const =0
 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)=0
 Initializes the backend. More...
 
virtual void clearBackBuffer ()=0
 Forces a clear of the backbuffer. More...
 
virtual void setLightingModel (uint32_t lighting)=0
 Initializes the light. More...
 
virtual uint32_t getLightingModel () const =0
 Gets the current light model. More...
 
virtual void setLighting (float red, float green, float blue)=0
 Set colors for lighting. More...
 
virtual void resetLighting ()=0
 Reset lighting with default values. More...
 
virtual void resetStencilBuffer (uint8_t buffer)=0
 Reset stencil buffer with given value. More...
 
virtual void changeBlending (int32_t scr, int32_t dst)=0
 Change the Blendingmodel. More...
 
void deinit ()
 Performs cleanup actions. More...
 
virtual void createMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon)=0
 Creates the mainscreen (the display window). More...
 
virtual void setScreenMode (const ScreenMode &mode)=0
 Sets the mainscreen display mode. More...
 
virtual ImagecreateImage (IResourceLoader *loader=0)=0
 
virtual ImagecreateImage (const std::string &name, IResourceLoader *loader=0)=0
 
virtual ImagecreateImage (const uint8_t *data, uint32_t width, uint32_t height)=0
 Creates an Image suitable for this renderbackend. More...
 
virtual ImagecreateImage (const std::string &name, const uint8_t *data, uint32_t width, uint32_t height)=0
 
virtual ImagecreateImage (SDL_Surface *surface)=0
 Helper function to create images from SDL_Surfaces. More...
 
virtual ImagecreateImage (const std::string &name, SDL_Surface *surface)=0
 
virtual void renderVertexArrays ()=0
 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)=0
 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)=0
 Dirty helper function to change the render infos. More...
 
virtual void captureScreen (const std::string &filename)=0
 Creates a Screenshot and saves it to a file. More...
 
virtual void captureScreen (const std::string &filename, uint32_t width, uint32_t height)=0
 Creates a Screenshot with the given size(w,h) and saves it to a file. 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...
 
virtual bool putPixel (int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 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)=0
 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)=0
 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)=0
 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)=0
 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)=0
 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)=0
 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)=0
 Draws a light primitive that based on a triangle fan. 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...
 
virtual void attachRenderTarget (ImagePtr &img, bool discard)=0
 Attaches given image as a new render surface. More...
 
virtual void detachRenderTarget ()=0
 Detaches current 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)=0
 Sets given clip area into image. More...
 
void clearClipArea ()
 Clears any possible clip areas. More...
 

Protected Attributes

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
 

Private Attributes

bool m_isframelimit
 
uint32_t m_frame_start
 
uint16_t m_framelimit
 

Additional Inherited Members

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

Detailed Description

Abstract interface for all the renderbackends.

Definition at line 92 of file renderbackend.h.

Constructor & Destructor Documentation

FIFE::RenderBackend::RenderBackend ( const SDL_Color &  colorkey)

Constructor.

Parameters
colorkeyThe colorkey to use.

Definition at line 34 of file renderbackend.cpp.

References m_backgroundcolor, and m_isbackgroundcolor.

FIFE::RenderBackend::~RenderBackend ( )
virtual

Destructor.

Definition at line 52 of file renderbackend.cpp.

Member Function Documentation

virtual void FIFE::RenderBackend::addImageToArray ( uint32_t  id,
const Rect rec,
float const *  st,
uint8_t  alpha,
uint8_t const *  rgba 
)
pure virtual

Add the Image data to the array.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::GLImage::render(), and FIFE::GLeImage::render().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::attachRenderTarget ( ImagePtr img,
bool  discard 
)
pure virtual

Attaches given image as a new render surface.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::TargetRenderer::render(), and FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::captureScreen ( const std::string &  filename)
pure virtual

Creates a Screenshot and saves it to a file.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

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

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

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

virtual void FIFE::RenderBackend::changeBlending ( int32_t  scr,
int32_t  dst 
)
pure virtual

Change the Blendingmodel.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

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

Forces a clear of the backbuffer.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Engine::pump().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::clearClipArea ( )
protected

Clears any possible clip areas.

See Also
pushClipArea

Definition at line 124 of file renderbackend.cpp.

References getArea(), and setClipArea().

virtual Image* FIFE::RenderBackend::createImage ( const std::string &  name,
IResourceLoader loader = 0 
)
pure virtual
virtual Image* FIFE::RenderBackend::createImage ( const uint8_t *  data,
uint32_t  width,
uint32_t  height 
)
pure 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.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

virtual Image* FIFE::RenderBackend::createImage ( const std::string &  name,
const uint8_t *  data,
uint32_t  width,
uint32_t  height 
)
pure virtual
virtual Image* FIFE::RenderBackend::createImage ( SDL_Surface *  surface)
pure virtual

Helper function to create images from SDL_Surfaces.

Takes ownership over the surface.

Parameters
surfaceThe surface to convert.
Returns
The new Image.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

virtual Image* FIFE::RenderBackend::createImage ( const std::string &  name,
SDL_Surface *  surface 
)
pure virtual
virtual void FIFE::RenderBackend::createMainScreen ( const ScreenMode mode,
const std::string &  title,
const std::string &  icon 
)
pure 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.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::deinit ( )

Performs cleanup actions.

Definition at line 55 of file renderbackend.cpp.

Referenced by FIFE::RenderBackendOpenGL::~RenderBackendOpenGL(), FIFE::RenderBackendOpenGLe::~RenderBackendOpenGLe(), and FIFE::RenderBackendSDL::~RenderBackendSDL().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::detachRenderTarget ( )
pure virtual

Detaches current render surface.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::TargetRenderer::render(), and FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::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 
)
pure virtual

Draws a light primitive that based on a triangle fan.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::LightRendererSimpleLightInfo::render().

+ Here is the caller graph for this function:

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

Draws quad between given points with given RGBA.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::OffRendererQuadInfo::render(), and FIFE::GenericRendererQuadInfo::render().

+ Here is the caller graph for this function:

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

Draws an axis parallel rectangle.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::FloatingTextRenderer::render().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::drawTriangle ( const Point p1,
const Point p2,
const Point p3,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
pure virtual

Draws triangle between given points with given RGBA.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::OffRendererTriangleInfo::render(), and FIFE::GenericRendererTriangleInfo::render().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::drawVertex ( const Point p,
const uint8_t  size,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
pure virtual

Draws a quad that represents a vertex with given RGBA.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::OffRendererVertexInfo::render(), and FIFE::GenericRendererVertexInfo::render().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::endFrame ( )
virtual

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

Reimplemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Definition at line 68 of file renderbackend.cpp.

References m_frame_start, m_framelimit, and m_isframelimit.

Referenced by FIFE::RenderBackendOpenGLe::endFrame(), FIFE::RenderBackendSDL::endFrame(), FIFE::RenderBackendOpenGL::endFrame(), and FIFE::Engine::pump().

+ Here is the caller graph for this function:

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

Draws a filled axis parallel rectangle.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::FloatingTextRenderer::render(), and FIFE::Camera::renderOverlay().

+ Here is the caller graph for this function:

const Rect & FIFE::RenderBackend::getArea ( ) const

Definition at line 90 of file renderbackend.cpp.

References m_screen.

Referenced by clearClipArea(), getClipArea(), popClipArea(), and FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

const Rect & FIFE::RenderBackend::getClipArea ( ) const

Gets the current clip area.

See Also
pushClipArea

Definition at line 116 of file renderbackend.cpp.

References getArea(), and m_clipstack.

const SDL_Color & FIFE::RenderBackend::getColorKey ( ) const

Gets the global colorkey setting.

Definition at line 141 of file renderbackend.cpp.

References m_colorkey.

Referenced by FIFE::GLImage::resetGlimage(), FIFE::GLeImage::resetGlimage(), FIFE::SDLImage::resetSdlimage(), and FIFE::SubImageFont::SubImageFont().

+ Here is the caller graph for this function:

const ScreenMode & FIFE::RenderBackend::getCurrentScreenMode ( ) const

Get current screen mode.

Returns
The current screen mode

Definition at line 78 of file renderbackend.cpp.

References m_screenMode.

uint16_t FIFE::RenderBackend::getFrameLimit ( ) const

Gets the frame limit.

Definition at line 174 of file renderbackend.cpp.

References m_framelimit.

virtual const std::string& FIFE::RenderBackend::getName ( ) const
pure virtual

The name of the renderbackend.

Returns
The name of this renderbackend.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::InstanceRenderer::InstanceRenderer(), FIFE::ImageLoader::load(), FIFE::Camera::render(), and FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

const SDL_PixelFormat & FIFE::RenderBackend::getPixelFormat ( ) const

Gets the current screen rgba format.

Definition at line 158 of file renderbackend.cpp.

References m_rgba_format.

Referenced by FIFE::ImageLoader::load().

+ Here is the caller graph for this function:

SDL_Surface * FIFE::RenderBackend::getRenderTargetSurface ( )

Returns currently attached render surface.

Definition at line 178 of file renderbackend.cpp.

References m_target.

Referenced by FIFE::GLImage::generateGLTexture(), FIFE::GLeImage::generateGLTexture(), FIFE::SDLImage::render(), FIFE::GLImage::render(), and FIFE::GLeImage::renderCheck().

+ Here is the caller graph for this function:

uint32_t FIFE::RenderBackend::getScreenHeight ( ) const
inline

Definition at line 212 of file renderbackend.h.

References getHeight().

Referenced by FIFE::MapLoader::load(), and FIFE::Console::reLayout().

+ Here is the caller graph for this function:

uint32_t FIFE::RenderBackend::getScreenWidth ( ) const
inline

Definition at line 211 of file renderbackend.h.

References getWidth().

Referenced by FIFE::MapLoader::load(), and FIFE::Console::reLayout().

+ Here is the caller graph for this function:

uint32_t FIFE::RenderBackend::getWidth ( ) const
virtual void FIFE::RenderBackend::init ( const std::string &  driver)
pure virtual

Initializes the backend.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isAlphaOptimizerEnabled ( ) const
inline
See Also
setAlphaOptimizerEnabled

Definition at line 273 of file renderbackend.h.

References m_isalphaoptimized.

Referenced by FIFE::SDLImage::finalize().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isColorKeyEnabled ( ) const

Gets whether the colorkey feature is in use.

Definition at line 133 of file renderbackend.cpp.

References m_iscolorkeyenabled.

Referenced by FIFE::GLImage::generateGLTexture(), and FIFE::GLeImage::generateGLTexture().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isFramebufferEnabled ( ) const
inline
See Also
setFramebufferEnabled

Definition at line 290 of file renderbackend.h.

References m_useframebuffer.

bool FIFE::RenderBackend::isFrameLimitEnabled ( ) const

Gets whether the frame limiter is in use.

Definition at line 166 of file renderbackend.cpp.

References m_isframelimit.

bool FIFE::RenderBackend::isImageCompressingEnabled ( ) const
inline
See Also
setImageCompressingEnabled

Definition at line 282 of file renderbackend.h.

References m_compressimages.

Referenced by FIFE::GuiImageLoader::load().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isNPOTEnabled ( ) const
inline
See Also
setNPOTEnabled

Definition at line 298 of file renderbackend.h.

References m_usenpot.

void FIFE::RenderBackend::pushClipArea ( const Rect cliparea,
bool  clear = true 
)

Pushes clip area to clip stack Clip areas define which area is drawn on screen.

Usable e.g. with viewports note that previous items in stack do not affect the latest area pushed

Definition at line 95 of file renderbackend.cpp.

References FIFE::RenderBackend::ClipInfo::clearing, m_clipstack, FIFE::RenderBackend::ClipInfo::r, and setClipArea().

Referenced by FIFE::OpenGLGuiGraphics::_beginDraw(), FIFE::OpenGLeGuiGraphics::_beginDraw(), FIFE::Cursor::draw(), FIFE::OpenGLeGuiGraphics::pushClipArea(), FIFE::OpenGLGuiGraphics::pushClipArea(), FIFE::OffRenderer::render(), FIFE::Camera::render(), and FIFE::Camera::renderStaticLayer().

+ Here is the caller graph for this function:

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

Writes pixel to given position.

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

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendOpenGLe, and FIFE::RenderBackendSDL.

Referenced by FIFE::OffRendererPointInfo::render(), and FIFE::GenericRendererPointInfo::render().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::renderVertexArrays ( )
pure virtual

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

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Cursor::draw(), FIFE::OffRenderer::render(), and FIFE::Camera::render().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::resetBackgroundColor ( )

Reset the background color to black.

Definition at line 154 of file renderbackend.cpp.

References setBackgroundColor().

virtual void FIFE::RenderBackend::resetLighting ( )
pure virtual

Reset lighting with default values.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Camera::render(), and FIFE::Camera::resetLightingColor().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::resetStencilBuffer ( uint8_t  buffer)
pure virtual

Reset stencil buffer with given value.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Camera::render().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setAlphaOptimizerEnabled ( bool  enabled)
inline

Enable or disable the alpha 'optimizing' code.

Parameters
enabledOptimize whether the image shall be analysed for 'fake' alpha images. Only implemented by and useful for the SDL backend at the moment.

Definition at line 269 of file renderbackend.h.

References m_isalphaoptimized.

void FIFE::RenderBackend::setBackgroundColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Set the background color.

Definition at line 145 of file renderbackend.cpp.

References m_backgroundcolor, and m_isbackgroundcolor.

Referenced by resetBackgroundColor().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::setClipArea ( const Rect cliparea,
bool  clear 
)
protectedpure virtual

Sets given clip area into image.

See Also
pushClipArea

Implemented in FIFE::RenderBackendOpenGLe, FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

Referenced by clearClipArea(), popClipArea(), and pushClipArea().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setColorKey ( const SDL_Color &  colorkey)

Sets the global colorkey to use for images.

Definition at line 137 of file renderbackend.cpp.

References m_colorkey.

void FIFE::RenderBackend::setColorKeyEnabled ( bool  colorkeyenable)

Sets whether to use the colorkey feature.

Definition at line 129 of file renderbackend.cpp.

References m_iscolorkeyenabled.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setFramebufferEnabled ( bool  enabled)
inline

Enables or disable the usage of the framebuffer, if available.

Definition at line 286 of file renderbackend.h.

References m_useframebuffer.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setFrameLimit ( uint16_t  framelimit)

Sets the frame limit.

Definition at line 170 of file renderbackend.cpp.

References m_framelimit.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setFrameLimitEnabled ( bool  limited)

Sets whether to use the frame limiter.

Definition at line 162 of file renderbackend.cpp.

References m_isframelimit.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setImageCompressingEnabled ( bool  enabled)
inline

Enables or disable compressing images by video driver.

Remarks
This is relevant for in OpenGL renderbackend

Definition at line 278 of file renderbackend.h.

References m_compressimages.

Referenced by FIFE::Engine::init(), and FIFE::GuiImageLoader::load().

+ Here is the caller graph for this function:

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

Set colors for lighting.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Camera::render().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::setLightingModel ( uint32_t  lighting)
pure virtual

Initializes the light.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setNPOTEnabled ( bool  enabled)
inline

Enables or disable the usage of npot, if available.

Definition at line 294 of file renderbackend.h.

References m_usenpot.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::setScreenMode ( const ScreenMode mode)
pure virtual

Sets the mainscreen display mode.

Parameters
modeThe ScreenMode to change the display to.
See Also
FIFE::ScreenMode.

Implemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Referenced by FIFE::Engine::changeScreenMode().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::startFrame ( )
virtual

Called when a new frame starts.

Reimplemented in FIFE::RenderBackendOpenGL, FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGLe.

Definition at line 62 of file renderbackend.cpp.

References m_frame_start, and m_isframelimit.

Referenced by FIFE::Engine::pump(), FIFE::RenderBackendOpenGLe::startFrame(), FIFE::RenderBackendSDL::startFrame(), and FIFE::RenderBackendOpenGL::startFrame().

+ Here is the caller graph for this function:

Member Data Documentation

SDL_Color FIFE::RenderBackend::m_backgroundcolor
protected
std::stack<ClipInfo> FIFE::RenderBackend::m_clipstack
protected

Definition at line 386 of file renderbackend.h.

Referenced by getClipArea(), popClipArea(), and pushClipArea().

SDL_Color FIFE::RenderBackend::m_colorkey
protected

Definition at line 364 of file renderbackend.h.

Referenced by getColorKey(), and setColorKey().

bool FIFE::RenderBackend::m_compressimages
protected

Definition at line 359 of file renderbackend.h.

Referenced by isImageCompressingEnabled(), and setImageCompressingEnabled().

uint32_t FIFE::RenderBackend::m_frame_start
private

Definition at line 390 of file renderbackend.h.

Referenced by endFrame(), and startFrame().

uint16_t FIFE::RenderBackend::m_framelimit
private

Definition at line 391 of file renderbackend.h.

Referenced by endFrame(), getFrameLimit(), and setFrameLimit().

bool FIFE::RenderBackend::m_isalphaoptimized
protected

Definition at line 362 of file renderbackend.h.

Referenced by isAlphaOptimizerEnabled(), and setAlphaOptimizerEnabled().

bool FIFE::RenderBackend::m_isbackgroundcolor
protected
bool FIFE::RenderBackend::m_iscolorkeyenabled
protected

Definition at line 363 of file renderbackend.h.

Referenced by isColorKeyEnabled(), and setColorKeyEnabled().

bool FIFE::RenderBackend::m_isframelimit
private

Definition at line 389 of file renderbackend.h.

Referenced by endFrame(), isFrameLimitEnabled(), setFrameLimitEnabled(), and startFrame().

bool FIFE::RenderBackend::m_usenpot
protected

Definition at line 361 of file renderbackend.h.

Referenced by isNPOTEnabled(), and setNPOTEnabled().


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