FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::RenderBackendSDL Class Reference

#include <renderbackendsdl.h>

Inheritance diagram for FIFE::RenderBackendSDL:
Inheritance graph
Collaboration diagram for FIFE::RenderBackendSDL:
Collaboration graph

List of all members.

Public Member Functions

const std::string & getName () const
void startFrame ()
void endFrame ()
void init (const std::string &driver)
void clearBackBuffer ()
void setLightingModel (unsigned int lighting)
unsigned int getLightingModel () const
void enableLighting ()
void disableLighting ()
void setLighting (float red, float green, float blue, float alpha)
void resetLighting ()
void enableStencilTest ()
void disableStencilTest ()
uint8_t getStencilRef () const
void enableAlphaTest ()
void disableAlphaTest ()
void setAlphaTest (float ref_alpha)
void changeBlending (int scr, int dst)
ImagecreateMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon)
ImagesetScreenMode (const ScreenMode &mode)
ImagecreateImage (const uint8_t *data, unsigned int width, unsigned int height)
ImagecreateImage (SDL_Surface *surface)
- Public Member Functions inherited from FIFE::RenderBackend
 RenderBackend (const SDL_Color &colorkey)
virtual ~RenderBackend ()
virtual void setStencilTest (Uint8 stencil_ref, unsigned int stencil_op, unsigned int stencil_func)=0
virtual void resetStencilBuffer (Uint8 buffer)=0
virtual void deinit ()
ImagegetScreenImage () const
void captureScreen (const std::string &filename)
const ScreenMode & getCurrentScreenMode () const
void setColorKeyEnabled (bool colorkeyenable)
bool isColorKeyEnabled () const
void setColorKey (const SDL_Color &colorkey)
const SDL_Color & getColorKey () const
- Public Member Functions inherited from FIFE::AbstractImage
virtual SDL_Surface * getSurface ()=0
virtual unsigned int getWidth () const =0
virtual unsigned int getHeight () const =0
virtual const RectgetArea ()=0
virtual bool putPixel (int x, int y, int r, int g, int b, int a=255)=0
virtual void drawLine (const Point &p1, const Point &p2, int r, int g, int b, int a=255)=0
virtual void drawTriangle (const Point &p1, const Point &p2, const Point &p3, int r, int g, int b, int a=255)=0
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
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
virtual void drawQuad (const Point &p1, const Point &p2, const Point &p3, const Point &p4, int r, int g, int b, int a=255)=0
virtual void drawVertex (const Point &p, const uint8_t size, int r, int g, int b, int a=255)=0
virtual void drawLightPrimitive (const Point &p, uint8_t intensity, float radius, int subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue)=0
virtual void getPixelRGBA (int x, int y, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)=0
virtual void pushClipArea (const Rect &cliparea, bool clear=true)=0
virtual void popClipArea ()=0
virtual const RectgetClipArea () const =0
virtual void saveImage (const std::string &filename)=0
virtual void setAlphaOptimizerEnabled (bool enabled)=0
virtual bool isAlphaOptimizerEnabled ()=0

Detailed Description

The main class of the SDL-based renderer.

See also:
RenderBackend

Definition at line 43 of file renderbackendsdl.h.


Member Function Documentation

void FIFE::RenderBackendSDL::changeBlending ( int  scr,
int  dst 
)
virtual

Change the Blendingmodel.

Implements FIFE::RenderBackend.

Definition at line 196 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::clearBackBuffer ( )
virtual

Forces a clear of the backbuffer

Implements FIFE::RenderBackend.

Definition at line 71 of file renderbackendsdl.cpp.

Image * FIFE::RenderBackendSDL::createImage ( const uint8_t *  data,
unsigned int  width,
unsigned int  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 147 of file renderbackendsdl.cpp.

Image * FIFE::RenderBackendSDL::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 143 of file renderbackendsdl.cpp.

Image * FIFE::RenderBackendSDL::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:
titeThe window title to use.
iconThe window icon to use.
Returns:
The new Screen Image

Implements FIFE::RenderBackend.

Definition at line 81 of file renderbackendsdl.cpp.

References setScreenMode().

void FIFE::RenderBackendSDL::disableAlphaTest ( )
virtual

Disable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 190 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::disableLighting ( )
virtual

Disable the lighting.

Implements FIFE::RenderBackend.

Definition at line 162 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::disableStencilTest ( )
virtual

Disable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 174 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::enableAlphaTest ( )
virtual

Enable the alpha test.

Implements FIFE::RenderBackend.

Definition at line 187 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::enableLighting ( )
virtual

Enable the lighting.

Implements FIFE::RenderBackend.

Definition at line 159 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::enableStencilTest ( )
virtual

Enable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 171 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::endFrame ( )
virtual

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

Implements FIFE::RenderBackend.

Definition at line 139 of file renderbackendsdl.cpp.

unsigned int FIFE::RenderBackendSDL::getLightingModel ( ) const
virtual

Gets the current light model.

Implements FIFE::RenderBackend.

Definition at line 155 of file renderbackendsdl.cpp.

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

The name of the renderbackend.

Returns:
The name of this renderbackend.

Implements FIFE::RenderBackend.

Definition at line 52 of file renderbackendsdl.cpp.

uint8_t FIFE::RenderBackendSDL::getStencilRef ( ) const
virtual

Return the reference value for the stencil test.

Implements FIFE::RenderBackend.

Definition at line 183 of file renderbackendsdl.cpp.

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

Initializes the backend.

Implements FIFE::RenderBackend.

Definition at line 57 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::resetLighting ( )
virtual

Reset lighting with default values.

Implements FIFE::RenderBackend.

Definition at line 168 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::setAlphaTest ( float  ref_alpha)
virtual

Set reference for the alpha test.

Implements FIFE::RenderBackend.

Definition at line 193 of file renderbackendsdl.cpp.

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

Set colors for lighting

Implements FIFE::RenderBackend.

Definition at line 165 of file renderbackendsdl.cpp.

void FIFE::RenderBackendSDL::setLightingModel ( unsigned int  lighting)
virtual

Initializes the light.

Implements FIFE::RenderBackend.

Definition at line 151 of file renderbackendsdl.cpp.

Image * FIFE::RenderBackendSDL::setScreenMode ( const ScreenMode &  mode)
virtual

Sets the mainscreen display mode.

Parameters:
modeThe ScreenMode to change the display to.
See also:
FIFE::ScreenMode.
Returns:
The new Screen Image

Implements FIFE::RenderBackend.

Definition at line 96 of file renderbackendsdl.cpp.

Referenced by createMainScreen().

Here is the caller graph for this function:

void FIFE::RenderBackendSDL::startFrame ( )
virtual

Called when a new frame starts.

Implements FIFE::RenderBackend.

Definition at line 136 of file renderbackendsdl.cpp.


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