FIFE 2008.0
|
#include <renderbackend.h>
Public Member Functions | |
RenderBackend (const SDL_Color &colorkey) | |
virtual | ~RenderBackend () |
virtual const std::string & | getName () const =0 |
virtual void | startFrame ()=0 |
virtual void | endFrame ()=0 |
virtual void | init (const std::string &driver)=0 |
virtual void | clearBackBuffer ()=0 |
virtual void | setLightingModel (unsigned int lighting)=0 |
virtual unsigned int | getLightingModel () const =0 |
virtual void | enableLighting ()=0 |
virtual void | disableLighting ()=0 |
virtual void | setLighting (float red, float green, float blue, float alpha)=0 |
virtual void | resetLighting ()=0 |
virtual void | enableStencilTest ()=0 |
virtual void | disableStencilTest ()=0 |
virtual void | setStencilTest (Uint8 stencil_ref, unsigned int stencil_op, unsigned int stencil_func)=0 |
virtual void | resetStencilBuffer (Uint8 buffer)=0 |
virtual Uint8 | getStencilRef () const =0 |
virtual void | enableAlphaTest ()=0 |
virtual void | disableAlphaTest ()=0 |
virtual void | setAlphaTest (float ref_alpha)=0 |
virtual void | changeBlending (int scr, int dst)=0 |
virtual void | deinit () |
virtual Image * | createMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon)=0 |
virtual Image * | setScreenMode (const ScreenMode &mode)=0 |
virtual Image * | createImage (const uint8_t *data, unsigned int width, unsigned int height)=0 |
virtual Image * | createImage (SDL_Surface *surface)=0 |
Image * | getScreenImage () 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 |
Abstract interface for all the renderbackends.
Definition at line 52 of file renderbackend.h.
FIFE::RenderBackend::RenderBackend | ( | const SDL_Color & | colorkey | ) |
Constructor.
name | The name of the new renderbackend. |
Definition at line 36 of file renderbackend.cpp.
FIFE::RenderBackend::~RenderBackend | ( | ) | [virtual] |
Destructor.
Definition at line 44 of file renderbackend.cpp.
void FIFE::RenderBackend::captureScreen | ( | const std::string & | filename | ) |
Creates a Screenshot and saves it to a file.
Definition at line 53 of file renderbackend.cpp.
virtual void FIFE::RenderBackend::changeBlending | ( | int | scr, |
int | 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().
virtual Image* FIFE::RenderBackend::createImage | ( | const uint8_t * | data, |
unsigned int | width, | ||
unsigned int | height | ||
) | [pure virtual] |
Creates an Image suitable for this renderbackend.
data | Pointer to the imagedata (needs to be in RGBA, 8 bits per channel). |
width | Width of the image. |
height | Height of the image. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual Image* FIFE::RenderBackend::createImage | ( | SDL_Surface * | surface | ) | [pure virtual] |
Helper function to create images from SDL_Surfaces. Takes ownership over the surface.
surface | The surface to convert. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual Image* FIFE::RenderBackend::createMainScreen | ( | const ScreenMode & | mode, |
const std::string & | title, | ||
const std::string & | icon | ||
) | [pure virtual] |
Creates the mainscreen (the display window).
mode | The ScreenMode to use. |
tite | The window title to use. |
icon | The window icon to use. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::init().
void FIFE::RenderBackend::deinit | ( | ) | [virtual] |
Performs cleanup actions.
Definition at line 47 of file renderbackend.cpp.
Referenced by FIFE::Engine::destroy().
virtual void FIFE::RenderBackend::disableAlphaTest | ( | ) | [pure virtual] |
Disable the stencil test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual void FIFE::RenderBackend::disableLighting | ( | ) | [pure virtual] |
Disable the lighting.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::pump(), and FIFE::CellSelectionRenderer::render().
virtual void FIFE::RenderBackend::disableStencilTest | ( | ) | [pure virtual] |
Disable the stencil test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual void FIFE::RenderBackend::enableAlphaTest | ( | ) | [pure virtual] |
Enable the alpha test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual void FIFE::RenderBackend::enableLighting | ( | ) | [pure virtual] |
Enable the lighting.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::pump(), and FIFE::CellSelectionRenderer::render().
virtual void FIFE::RenderBackend::enableStencilTest | ( | ) | [pure virtual] |
Enable the stencil test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
virtual void FIFE::RenderBackend::endFrame | ( | ) | [pure virtual] |
Called when a frame is finished and ready to be displayed.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::pump().
const SDL_Color & FIFE::RenderBackend::getColorKey | ( | ) | const |
Gets the global colorkey setting
Definition at line 130 of file renderbackend.cpp.
const ScreenMode & FIFE::RenderBackend::getCurrentScreenMode | ( | ) | const |
Get current screen mode
Definition at line 77 of file renderbackend.cpp.
virtual unsigned int FIFE::RenderBackend::getLightingModel | ( | ) | const [pure virtual] |
Gets the current light model.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render().
virtual const std::string& FIFE::RenderBackend::getName | ( | ) | const [pure virtual] |
The name of the renderbackend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::Camera().
Image* FIFE::RenderBackend::getScreenImage | ( | ) | const [inline] |
Returns a pointer to the main screen Image
Definition at line 180 of file renderbackend.h.
virtual Uint8 FIFE::RenderBackend::getStencilRef | ( | ) | const [pure virtual] |
Return the reference value for the stencil test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
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().
bool FIFE::RenderBackend::isColorKeyEnabled | ( | ) | const |
Gets whether the colorkey feature is in use
Definition at line 122 of file renderbackend.cpp.
virtual void FIFE::RenderBackend::resetLighting | ( | ) | [pure virtual] |
Reset lighting with default values.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render().
virtual void FIFE::RenderBackend::resetStencilBuffer | ( | Uint8 | buffer | ) | [pure virtual] |
Reset stencil buffer with given value.
Referenced by FIFE::Camera::render().
virtual void FIFE::RenderBackend::setAlphaTest | ( | float | ref_alpha | ) | [pure virtual] |
Set reference for the alpha test.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
void FIFE::RenderBackend::setColorKey | ( | const SDL_Color & | colorkey | ) |
Sets the global colorkey to use for images
Definition at line 126 of file renderbackend.cpp.
void FIFE::RenderBackend::setColorKeyEnabled | ( | bool | colorkeyenable | ) |
Sets whether to use the colorkey feature
Definition at line 118 of file renderbackend.cpp.
Referenced by FIFE::Engine::init().
virtual void FIFE::RenderBackend::setLighting | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) | [pure virtual] |
Set colors for lighting
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Camera::render().
virtual void FIFE::RenderBackend::setLightingModel | ( | unsigned int | lighting | ) | [pure virtual] |
Initializes the light.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::init().
virtual Image* FIFE::RenderBackend::setScreenMode | ( | const ScreenMode & | mode | ) | [pure virtual] |
Sets the mainscreen display mode.
mode | The ScreenMode to change the display to. |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::changeScreenMode().
virtual void FIFE::RenderBackend::setStencilTest | ( | Uint8 | stencil_ref, |
unsigned int | stencil_op, | ||
unsigned int | stencil_func | ||
) | [pure virtual] |
Set reference for the stencil test.
virtual void FIFE::RenderBackend::startFrame | ( | ) | [pure virtual] |
Called when a new frame starts.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Referenced by FIFE::Engine::pump().