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 |
![]() | |
virtual SDL_Surface * | getSurface ()=0 |
virtual unsigned int | getWidth () const =0 |
virtual unsigned int | getHeight () const =0 |
virtual const Rect & | getArea ()=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 Rect & | getClipArea () const =0 |
virtual void | saveImage (const std::string &filename)=0 |
virtual void | setAlphaOptimizerEnabled (bool enabled)=0 |
virtual bool | isAlphaOptimizerEnabled ()=0 |
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.
|
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.
|
pure virtual |
Change the Blendingmodel.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Forces a clear of the backbuffer
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::pump().
|
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::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Helper function to create images from SDL_Surfaces. Takes ownership over the surface.
surface | The surface to convert. |
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
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::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::init().
|
virtual |
Performs cleanup actions.
Definition at line 47 of file renderbackend.cpp.
Referenced by FIFE::Engine::destroy().
|
pure virtual |
Disable the stencil test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Disable the lighting.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::pump(), and FIFE::CellSelectionRenderer::render().
|
pure virtual |
Disable the stencil test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Enable the alpha test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Enable the lighting.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::pump(), and FIFE::CellSelectionRenderer::render().
|
pure virtual |
Enable the stencil test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Called when a frame is finished and ready to be displayed.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
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.
|
pure virtual |
Gets the current light model.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Camera::render().
|
pure virtual |
The name of the renderbackend.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Camera::Camera().
|
inline |
Returns a pointer to the main screen Image
Definition at line 180 of file renderbackend.h.
|
pure virtual |
Return the reference value for the stencil test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
|
pure virtual |
Initializes the backend.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
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.
|
pure virtual |
Reset lighting with default values.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Camera::render().
|
pure virtual |
Reset stencil buffer with given value.
Referenced by FIFE::Camera::render().
|
pure virtual |
Set reference for the alpha test.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
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().
|
pure virtual |
Set colors for lighting
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Camera::render().
|
pure virtual |
Initializes the light.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::init().
|
pure virtual |
Sets the mainscreen display mode.
mode | The ScreenMode to change the display to. |
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::changeScreenMode().
|
pure virtual |
Set reference for the stencil test.
|
pure virtual |
Called when a new frame starts.
Implemented in FIFE::RenderBackendSDL, and FIFE::RenderBackendOpenGL.
Referenced by FIFE::Engine::pump().