FIFE
2008.0
|
#include <renderbackendopengl.h>
Public Member Functions | |
virtual const std::string & | getName () const |
virtual void | startFrame () |
virtual void | endFrame () |
virtual void | init (const std::string &driver) |
virtual void | clearBackBuffer () |
virtual void | setLightingModel (uint32_t lighting) |
virtual uint32_t | getLightingModel () const |
virtual void | setLighting (float red, float green, float blue) |
virtual void | resetLighting () |
virtual void | resetStencilBuffer (uint8_t buffer) |
virtual void | changeBlending (int32_t scr, int32_t dst) |
virtual void | createMainScreen (const ScreenMode &mode, const std::string &title, const std::string &icon) |
virtual void | setScreenMode (const ScreenMode &mode) |
virtual Image * | createImage (const uint8_t *data, uint32_t width, uint32_t height) |
virtual Image * | createImage (SDL_Surface *surface) |
virtual void | renderVertexArrays () |
virtual void | addImageToArray (uint32_t id, const Rect &rec, float const *st, uint8_t alpha, uint8_t const *rgb) |
virtual void | changeRenderInfos (uint16_t elements, int32_t src, int32_t dst, bool light, bool stentest, uint8_t stenref, GLConstants stenop, GLConstants stenfunc) |
virtual void | captureScreen (const std::string &filename) |
virtual void | captureScreen (const std::string &filename, uint32_t width, uint32_t height) |
virtual bool | putPixel (int32_t x, int32_t y, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
virtual void | drawLine (const Point &p1, const Point &p2, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
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) |
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) |
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) |
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) |
virtual void | drawVertex (const Point &p, const uint8_t size, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
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) |
virtual void | attachRenderTarget (ImagePtr &img, bool discard) |
virtual void | detachRenderTarget () |
![]() | |
RenderBackend (const SDL_Color &colorkey) | |
virtual | ~RenderBackend () |
void | deinit () |
const ScreenMode & | getCurrentScreenMode () const |
void | pushClipArea (const Rect &cliparea, bool clear=true) |
void | popClipArea () |
const Rect & | getClipArea () const |
void | setAlphaOptimizerEnabled (bool enabled) |
bool | isAlphaOptimizerEnabled () const |
void | setImageCompressingEnabled (bool enabled) |
bool | isImageCompressingEnabled () const |
void | setFramebufferEnabled (bool enabled) |
bool | isFramebufferEnabled () const |
void | setNPOTEnabled (bool enabled) |
bool | isNPOTEnabled () const |
void | setColorKeyEnabled (bool colorkeyenable) |
bool | isColorKeyEnabled () const |
void | setColorKey (const SDL_Color &colorkey) |
const SDL_Color & | getColorKey () const |
void | setBackgroundColor (uint8_t r, uint8_t g, uint8_t b) |
void | resetBackgroundColor () |
const SDL_PixelFormat & | getPixelFormat () const |
void | setFrameLimitEnabled (bool limited) |
bool | isFrameLimitEnabled () const |
void | setFrameLimit (uint16_t framelimit) |
uint16_t | getFrameLimit () const |
SDL_Surface * | getRenderTargetSurface () |
Protected Member Functions | |
virtual void | setClipArea (const Rect &cliparea, bool clear) |
![]() | |
void | clearClipArea () |
The main class of the OpenGL-based renderer.
Definition at line 43 of file renderbackendopengl.h.
|
virtual |
Add the Image data to the array
Implements FIFE::RenderBackend.
Definition at line 974 of file renderbackendopengl.cpp.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
Referenced by attachRenderTarget().
|
virtual |
Attaches given image as a new render surface
Implements FIFE::RenderBackend.
Definition at line 1257 of file renderbackendopengl.cpp.
References addImageToArray(), FIFE::Image::forceLoadInternal(), and FIFE::SharedPtr< T >::get().
|
virtual |
Creates a Screenshot and saves it to a file.
Implements FIFE::RenderBackend.
Definition at line 1098 of file renderbackendopengl.cpp.
References FIFE::Image::saveAsPng().
Referenced by captureScreen().
|
virtual |
Creates a Screenshot with the given size(w,h) and saves it to a file.
Implements FIFE::RenderBackend.
Definition at line 1132 of file renderbackendopengl.cpp.
References captureScreen(), and FIFE::Image::saveAsPng().
|
virtual |
Change the Blendingmodel.
Implements FIFE::RenderBackend.
Definition at line 533 of file renderbackendopengl.cpp.
Referenced by renderVertexArrays().
|
virtual |
Dirty helper function to change the render infos
Implements FIFE::RenderBackend.
Definition at line 570 of file renderbackendopengl.cpp.
|
virtual |
Forces a clear of the backbuffer
Implements FIFE::RenderBackend.
Definition at line 127 of file renderbackendopengl.cpp.
|
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. |
Implements FIFE::RenderBackend.
Definition at line 310 of file renderbackendopengl.cpp.
|
virtual |
Helper function to create images from SDL_Surfaces. Takes ownership over the surface.
surface | The surface to convert. |
Implements FIFE::RenderBackend.
Definition at line 240 of file renderbackendopengl.cpp.
|
virtual |
Creates the mainscreen (the display window).
mode | The ScreenMode to use. |
tite | The window title to use. |
icon | The window icon to use. |
Implements FIFE::RenderBackend.
Definition at line 133 of file renderbackendopengl.cpp.
References setScreenMode().
|
virtual |
Detaches current render surface
Implements FIFE::RenderBackend.
Definition at line 1307 of file renderbackendopengl.cpp.
References FIFE::SharedPtr< T >::get(), and renderVertexArrays().
|
virtual |
Draws a light primitive that based on a triangle fan
Implements FIFE::RenderBackend.
Definition at line 945 of file renderbackendopengl.cpp.
|
virtual |
Draws line between given points with given RGBA
Implements FIFE::RenderBackend.
Definition at line 811 of file renderbackendopengl.cpp.
|
virtual |
Draws quad between given points with given RGBA
Implements FIFE::RenderBackend.
Definition at line 896 of file renderbackendopengl.cpp.
|
virtual |
Draws an axis parallel rectangle.
Implements FIFE::RenderBackend.
Definition at line 851 of file renderbackendopengl.cpp.
|
virtual |
Draws triangle between given points with given RGBA
Implements FIFE::RenderBackend.
Definition at line 829 of file renderbackendopengl.cpp.
|
virtual |
Draws a quad that represents a vertex with given RGBA
Implements FIFE::RenderBackend.
Definition at line 922 of file renderbackendopengl.cpp.
|
virtual |
Called when a frame is finished and ready to be displayed.
Reimplemented from FIFE::RenderBackend.
Definition at line 227 of file renderbackendopengl.cpp.
References FIFE::RenderBackend::endFrame().
|
virtual |
Draws a filled axis parallel rectangle.
Implements FIFE::RenderBackend.
Definition at line 873 of file renderbackendopengl.cpp.
|
virtual |
Gets the current light model.
Implements FIFE::RenderBackend.
Definition at line 333 of file renderbackendopengl.cpp.
|
virtual |
The name of the renderbackend.
Implements FIFE::RenderBackend.
Definition at line 111 of file renderbackendopengl.cpp.
|
virtual |
Initializes the backend.
Implements FIFE::RenderBackend.
Definition at line 116 of file renderbackendopengl.cpp.
|
virtual |
Writes pixel to given position. Returns true, if pixel was written (not out of bounds)
Implements FIFE::RenderBackend.
Definition at line 791 of file renderbackendopengl.cpp.
|
virtual |
Render the Vertex Arrays, only for primitives (points, lines,...)
Implements FIFE::RenderBackend.
Definition at line 591 of file renderbackendopengl.cpp.
References changeBlending().
Referenced by detachRenderTarget().
|
virtual |
Reset lighting with default values.
Implements FIFE::RenderBackend.
Definition at line 409 of file renderbackendopengl.cpp.
References setLighting().
|
virtual |
Reset stencil buffer with given value.
Implements FIFE::RenderBackend.
Definition at line 443 of file renderbackendopengl.cpp.
|
protectedvirtual |
Sets given clip area into image
Implements FIFE::RenderBackend.
Definition at line 1243 of file renderbackendopengl.cpp.
References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
|
virtual |
Set colors for lighting
Implements FIFE::RenderBackend.
Definition at line 402 of file renderbackendopengl.cpp.
Referenced by resetLighting().
|
virtual |
Initializes the light.
Implements FIFE::RenderBackend.
Definition at line 318 of file renderbackendopengl.cpp.
|
virtual |
Sets the mainscreen display mode.
mode | The ScreenMode to change the display to. |
Implements FIFE::RenderBackend.
Definition at line 146 of file renderbackendopengl.cpp.
Referenced by createMainScreen().
|
virtual |
Called when a new frame starts.
Reimplemented from FIFE::RenderBackend.
Definition at line 223 of file renderbackendopengl.cpp.
References FIFE::RenderBackend::startFrame().