#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 ()=0 |
virtual void | deinit () |
virtual Image * | createMainScreen (unsigned int width, unsigned int height, unsigned char bitsPerPixel, bool fullscreen, const std::string &title, const std::string &icon)=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) |
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 50 of file renderbackend.h.
FIFE::RenderBackend::RenderBackend | ( | const SDL_Color & | colorkey | ) |
Constructor.
name | The name of the new renderbackend. |
Definition at line 37 of file renderbackend.cpp.
FIFE::RenderBackend::~RenderBackend | ( | ) | [virtual] |
Destructor.
Definition at line 46 of file renderbackend.cpp.
void FIFE::RenderBackend::captureScreen | ( | const std::string & | filename | ) |
Creates a Screenshot and saves it to a file.
Definition at line 55 of file renderbackend.cpp.
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 | ( | unsigned int | width, | |
unsigned int | height, | |||
unsigned char | bitsPerPixel, | |||
bool | fullscreen, | |||
const std::string & | title, | |||
const std::string & | icon | |||
) | [pure virtual] |
Creates the mainscreen (the display window).
width | Width of the window. | |
height | Height of the window. | |
bitsPerPixel | Bits per pixel, 0 means autodetect. | |
fullscreen | Use fullscreen mode? |
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
void FIFE::RenderBackend::deinit | ( | ) | [virtual] |
Performs cleanup actions.
Definition at line 49 of file renderbackend.cpp.
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.
const SDL_Color & FIFE::RenderBackend::getColorKey | ( | ) | const |
Gets the global colorkey setting
Definition at line 142 of file renderbackend.cpp.
virtual const std::string& FIFE::RenderBackend::getName | ( | ) | const [pure virtual] |
The name of the renderbackend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
Image* FIFE::RenderBackend::getScreenImage | ( | ) | const [inline] |
Returns a pointer to the main screen Image
Definition at line 109 of file renderbackend.h.
virtual void FIFE::RenderBackend::init | ( | ) | [pure virtual] |
Initializes the backend.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.
bool FIFE::RenderBackend::isColorKeyEnabled | ( | ) | const |
Gets whether the colorkey feature is in use
Definition at line 134 of file renderbackend.cpp.
void FIFE::RenderBackend::setColorKey | ( | const SDL_Color & | colorkey | ) |
Sets the global colorkey to use for images
Definition at line 138 of file renderbackend.cpp.
void FIFE::RenderBackend::setColorKeyEnabled | ( | bool | colorkeyenable | ) |
Sets whether to use the colorkey feature
Definition at line 130 of file renderbackend.cpp.
virtual void FIFE::RenderBackend::startFrame | ( | ) | [pure virtual] |
Called when a new frame starts.
Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.