FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
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 (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)=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...
 
SDL_Window * getWindow ()
 
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 drawThickLine (const Point &p1, const Point &p2, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 Draws line between given points with given RGBA and width. More...
 
virtual void drawPolyLine (const std::vector< Point > &points, uint8_t width, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 Draws lines between given points with given RGBA and width. More...
 
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)=0
 Draws bezier curve between given points with given RGBA and width. 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 drawCircle (const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 Draws a circle. More...
 
virtual void drawFillCircle (const Point &p, uint32_t radius, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
 Draws a filled circle. More...
 
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)=0
 Draws a circle segment. More...
 
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)=0
 Draws a filled circle segment. 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...
 
virtual void enableScissorTest ()=0
 Enables scissor test on the render backend. More...
 
virtual void disableScissorTest ()=0
 Disables scissor test on the render backend. 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 setTextureFiltering (TextureFiltering filter)
 Sets the texture filtering method. More...
 
TextureFiltering getTextureFiltering () const
 
void setMipmappingEnabled (bool enabled)
 Enables or disables the usage of mipmapping. More...
 
bool isMipmappingEnabled () const
 
int32_t getMaxAnisotropy () const
 Gets max antisotropy for antisotropic filtering. More...
 
void setMonochromeEnabled (bool enabled)
 Enables or disables monochrome rendering. More...
 
bool isMonochromeEnabled () const
 
void setDepthBufferEnabled (bool enabled)
 Enables or disables depth buffer rendering. More...
 
bool isDepthBufferEnabled () const
 
void setAlphaTestValue (float alpha)
 Sets the value for alpha test. More...
 
float getAlphaTestValue () 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 setVSyncEnabled (bool vsync)
 Sets whether to use VSync. More...
 
bool isVSyncEnabled () const
 Gets whether VSync is in use. 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 * getScreenSurface ()
 Returns screen render surface. 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...
 
virtual void renderGuiGeometry (const std::vector< GuiVertex > &vertices, const std::vector< int > &indices, const DoublePoint &translation, ImagePtr texture)=0
 Renders geometry required by gui. More...
 
Point getBezierPoint (const std::vector< Point > &points, int32_t elements, float t)
 Helper that returns an interpolated Point. More...
 
void addControlPoints (const std::vector< Point > &points, std::vector< Point > &newPoints)
 Helper that adds the control points for bezier curves. 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_Window * m_window
 
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
 
bool m_isMipmapping
 
TextureFiltering m_textureFilter
 
int32_t m_maxAnisotropy
 
bool m_monochrome
 
bool m_isDepthBuffer
 
float m_alphaValue
 
bool m_vSync
 
std::stack< ClipInfom_clipstack
 
ClipInfo m_guiClip
 

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 121 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 61 of file renderbackend.cpp.

Member Function Documentation

void FIFE::RenderBackend::addControlPoints ( const std::vector< Point > &  points,
std::vector< Point > &  newPoints 
)

Helper that adds the control points for bezier curves.

Definition at line 284 of file renderbackend.cpp.

References FIFE::PointType2D< T >::x, and FIFE::PointType2D< T >::y.

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, and FIFE::RenderBackendSDL.

Referenced by FIFE::GLImage::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, 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, 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, and FIFE::RenderBackendSDL.

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

Change the Blendingmodel.

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

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

Forces a clear of the backbuffer.

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

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 131 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, and FIFE::RenderBackendSDL.

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, and FIFE::RenderBackendSDL.

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, and FIFE::RenderBackendSDL.

Referenced by FIFE::Engine::changeScreenMode(), and FIFE::Engine::init().

+ Here is the caller graph for this function:

void FIFE::RenderBackend::deinit ( )

Performs cleanup actions.

Definition at line 64 of file renderbackend.cpp.

Referenced by FIFE::RenderBackendOpenGL::~RenderBackendOpenGL(), 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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

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

Disables scissor test on the render backend.

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

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

+ Here is the caller graph for this function:

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

Draws bezier curve between given points with given RGBA and width.

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

Referenced by FIFE::SdlGuiGraphics::drawBezier().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::drawCircle ( const Point p,
uint32_t  radius,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
pure virtual

Draws a circle.

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

Referenced by FIFE::SdlGuiGraphics::drawCircle().

+ Here is the caller graph for this function:

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

Draws a circle segment.

Note: The start angle must be less than the end angle. 0 angle is right side.

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

Referenced by FIFE::SdlGuiGraphics::drawCircleSegment().

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::drawFillCircle ( const Point p,
uint32_t  radius,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
pure virtual

Draws a filled circle.

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

Referenced by FIFE::SdlGuiGraphics::drawFillCircle().

+ Here is the caller graph for this function:

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

Draws a filled circle segment.

0 angle is right side. Note: The start angle must be less than the end angle.

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

Referenced by FIFE::SdlGuiGraphics::drawFillCircleSegment().

+ 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, 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::drawPolyLine ( const std::vector< Point > &  points,
uint8_t  width,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
pure virtual

Draws lines between given points with given RGBA and width.

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

Referenced by FIFE::SdlGuiGraphics::drawPolyLine().

+ Here is the caller graph for this function:

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, 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, and FIFE::RenderBackendSDL.

Referenced by FIFE::SdlGuiGraphics::drawRectangle(), and FIFE::FloatingTextRenderer::render().

+ Here is the caller graph for this function:

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

Draws line between given points with given RGBA and width.

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

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

+ 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, 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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

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

Enables scissor test on the render backend.

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

Referenced by FIFE::LibRocketRenderInterface::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, and FIFE::RenderBackendSDL.

Definition at line 75 of file renderbackend.cpp.

References m_frame_start, m_framelimit, and m_isframelimit.

Referenced by FIFE::RenderBackendOpenGL::endFrame(), FIFE::RenderBackendSDL::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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

float FIFE::RenderBackend::getAlphaTestValue ( ) const
See also
setAlphaValue

Definition at line 175 of file renderbackend.cpp.

References m_alphaValue.

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

Definition at line 97 of file renderbackend.cpp.

References m_screen.

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

+ Here is the caller graph for this function:

Point FIFE::RenderBackend::getBezierPoint ( const std::vector< Point > &  points,
int32_t  elements,
float  t 
)

Helper that returns an interpolated Point.

Definition at line 244 of file renderbackend.cpp.

References FIFE::Math< T >::Pow().

Referenced by FIFE::RenderBackendSDL::drawBezier(), and FIFE::RenderBackendOpenGL::drawBezier().

+ 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 123 of file renderbackend.cpp.

References getArea(), and m_clipstack.

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

Gets the global colorkey setting.

Definition at line 191 of file renderbackend.cpp.

References m_colorkey.

Referenced by FIFE::GLImage::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 85 of file renderbackend.cpp.

References m_screenMode.

uint16_t FIFE::RenderBackend::getFrameLimit ( ) const

Gets the frame limit.

Definition at line 232 of file renderbackend.cpp.

References m_framelimit.

int32_t FIFE::RenderBackend::getMaxAnisotropy ( ) const

Gets max antisotropy for antisotropic filtering.

Definition at line 151 of file renderbackend.cpp.

References m_maxAnisotropy.

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, and FIFE::RenderBackendSDL.

Referenced by FIFE::InstanceRenderer::InstanceRenderer(), FIFE::ImageLoader::load(), 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 208 of file renderbackend.cpp.

References m_rgba_format.

Referenced by FIFE::GLImage::generateGLTexture(), and FIFE::ImageLoader::load().

+ Here is the caller graph for this function:

SDL_Surface * FIFE::RenderBackend::getRenderTargetSurface ( )

Returns currently attached render surface.

Definition at line 240 of file renderbackend.cpp.

References m_target.

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

+ Here is the caller graph for this function:

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

Definition at line 243 of file renderbackend.h.

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

+ Here is the caller graph for this function:

SDL_Surface * FIFE::RenderBackend::getScreenSurface ( )

Returns screen render surface.

Definition at line 236 of file renderbackend.cpp.

References m_screen.

Referenced by FIFE::SdlGuiGraphics::SdlGuiGraphics(), and FIFE::SdlGuiGraphics::updateTarget().

+ Here is the caller graph for this function:

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

Definition at line 242 of file renderbackend.h.

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

+ Here is the caller graph for this function:

TextureFiltering FIFE::RenderBackend::getTextureFiltering ( ) const
See also
setTextureFiltering

Definition at line 139 of file renderbackend.cpp.

References m_textureFilter.

uint32_t FIFE::RenderBackend::getWidth ( ) const
SDL_Window* FIFE::RenderBackend::getWindow ( )
inline

Definition at line 233 of file renderbackend.h.

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

Initializes the backend.

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

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 341 of file renderbackend.h.

bool FIFE::RenderBackend::isColorKeyEnabled ( ) const

Gets whether the colorkey feature is in use.

Definition at line 183 of file renderbackend.cpp.

References m_iscolorkeyenabled.

Referenced by FIFE::GLImage::generateGLTexture().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isDepthBufferEnabled ( ) const
See also
setMonochromeEnabled

Definition at line 167 of file renderbackend.cpp.

References m_isDepthBuffer.

Referenced by FIFE::InstanceRenderer::InstanceRenderer().

+ Here is the caller graph for this function:

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

Definition at line 358 of file renderbackend.h.

Referenced by FIFE::CellRenderer::CellRenderer().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isFrameLimitEnabled ( ) const

Gets whether the frame limiter is in use.

Definition at line 224 of file renderbackend.cpp.

References m_isframelimit.

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

Definition at line 350 of file renderbackend.h.

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

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isMipmappingEnabled ( ) const
See also
setMipmappingEnabled

Definition at line 147 of file renderbackend.cpp.

References m_isMipmapping.

Referenced by FIFE::GLImage::generateGLTexture().

+ Here is the caller graph for this function:

bool FIFE::RenderBackend::isMonochromeEnabled ( ) const
See also
setMonochromeEnabled

Definition at line 159 of file renderbackend.cpp.

References m_monochrome.

Referenced by FIFE::GLImage::generateGLTexture().

+ Here is the caller graph for this function:

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

Definition at line 366 of file renderbackend.h.

bool FIFE::RenderBackend::isVSyncEnabled ( ) const

Gets whether VSync is in use.

Definition at line 216 of file renderbackend.cpp.

References m_vSync.

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 102 of file renderbackend.cpp.

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

Referenced by FIFE::OpenGLGuiGraphics::_beginDraw(), FIFE::SdlGuiGraphics::_beginDraw(), FIFE::Cursor::draw(), FIFE::OpenGLGuiGraphics::pushClipArea(), FIFE::SdlGuiGraphics::pushClipArea(), FIFE::LibRocketRenderInterface::render(), 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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

virtual void FIFE::RenderBackend::renderGuiGeometry ( const std::vector< GuiVertex > &  vertices,
const std::vector< int > &  indices,
const DoublePoint translation,
ImagePtr  texture 
)
pure virtual

Renders geometry required by gui.

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

Referenced by FIFE::LibRocketRenderInterface::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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::resetBackgroundColor ( )

Reset the background color to black.

Definition at line 204 of file renderbackend.cpp.

References setBackgroundColor().

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

Reset lighting with default values.

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

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, and FIFE::RenderBackendSDL.

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 337 of file renderbackend.h.

void FIFE::RenderBackend::setAlphaTestValue ( float  alpha)

Sets the value for alpha test.

Discards a fragment if its value is not greater. Only used if depth buffer is enabled. Note! Works only for OpenGL backend.

Definition at line 171 of file renderbackend.cpp.

References m_alphaValue.

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

+ Here is the caller graph for this function:

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

Set the background color.

Definition at line 195 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::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 187 of file renderbackend.cpp.

References m_colorkey.

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

Sets whether to use the colorkey feature.

Definition at line 179 of file renderbackend.cpp.

References m_iscolorkeyenabled.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setDepthBufferEnabled ( bool  enabled)

Enables or disables depth buffer rendering.

Note! Works only for OpenGL backend.

Definition at line 163 of file renderbackend.cpp.

References m_isDepthBuffer.

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 354 of file renderbackend.h.

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 228 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 220 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 346 of file renderbackend.h.

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, and FIFE::RenderBackendSDL.

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, and FIFE::RenderBackendSDL.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setMipmappingEnabled ( bool  enabled)

Enables or disables the usage of mipmapping.

Note! Works only for OpenGL backends.

Definition at line 143 of file renderbackend.cpp.

References m_isMipmapping.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setMonochromeEnabled ( bool  enabled)

Enables or disables monochrome rendering.

Note! Works only for OpenGL backends.

Definition at line 155 of file renderbackend.cpp.

References m_monochrome.

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 362 of file renderbackend.h.

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, and FIFE::RenderBackendSDL.

void FIFE::RenderBackend::setTextureFiltering ( TextureFiltering  filter)

Sets the texture filtering method.

Supports none, bilinear, trilinear and anisotropic filtering. Note! Works only for OpenGL backends.

See also
TextureFiltering

Definition at line 135 of file renderbackend.cpp.

References m_textureFilter.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::setVSyncEnabled ( bool  vsync)

Sets whether to use VSync.

Definition at line 212 of file renderbackend.cpp.

References m_vSync.

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

+ Here is the caller graph for this function:

void FIFE::RenderBackend::startFrame ( )
virtual

Called when a new frame starts.

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

Definition at line 69 of file renderbackend.cpp.

References m_frame_start, and m_isframelimit.

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

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 547 of file renderbackend.h.

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

SDL_Color FIFE::RenderBackend::m_colorkey
protected

Definition at line 515 of file renderbackend.h.

Referenced by getColorKey(), and setColorKey().

bool FIFE::RenderBackend::m_compressimages
protected

Definition at line 510 of file renderbackend.h.

uint32_t FIFE::RenderBackend::m_frame_start
private

Definition at line 552 of file renderbackend.h.

Referenced by endFrame(), and startFrame().

uint16_t FIFE::RenderBackend::m_framelimit
private

Definition at line 553 of file renderbackend.h.

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

ClipInfo FIFE::RenderBackend::m_guiClip
protected

Definition at line 549 of file renderbackend.h.

bool FIFE::RenderBackend::m_isalphaoptimized
protected

Definition at line 513 of file renderbackend.h.

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

Definition at line 514 of file renderbackend.h.

Referenced by isColorKeyEnabled(), and setColorKeyEnabled().

bool FIFE::RenderBackend::m_isDepthBuffer
protected

Definition at line 531 of file renderbackend.h.

Referenced by isDepthBufferEnabled(), and setDepthBufferEnabled().

bool FIFE::RenderBackend::m_isframelimit
private

Definition at line 551 of file renderbackend.h.

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

bool FIFE::RenderBackend::m_isMipmapping
protected

Definition at line 523 of file renderbackend.h.

Referenced by isMipmappingEnabled(), and setMipmappingEnabled().

int32_t FIFE::RenderBackend::m_maxAnisotropy
protected

Definition at line 527 of file renderbackend.h.

Referenced by getMaxAnisotropy(), and FIFE::RenderBackendOpenGL::setScreenMode().

bool FIFE::RenderBackend::m_monochrome
protected

Definition at line 529 of file renderbackend.h.

Referenced by isMonochromeEnabled(), and setMonochromeEnabled().

ScreenMode FIFE::RenderBackend::m_screenMode
protected
TextureFiltering FIFE::RenderBackend::m_textureFilter
protected
bool FIFE::RenderBackend::m_usenpot
protected

Definition at line 512 of file renderbackend.h.

bool FIFE::RenderBackend::m_vSync
protected

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