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

#include <renderbackendopengl.h>

Inheritance diagram for FIFE::RenderBackendOpenGL:
Collaboration diagram for FIFE::RenderBackendOpenGL:

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)

Detailed Description

The main class of the OpenGL-based renderer.

See also:
RenderBackend

Definition at line 42 of file renderbackendopengl.h.


Member Function Documentation

void FIFE::RenderBackendOpenGL::changeBlending ( int  scr,
int  dst 
) [virtual]

Change the Blendingmodel.

Implements FIFE::RenderBackend.

Definition at line 345 of file renderbackendopengl.cpp.

Forces a clear of the backbuffer

Implements FIFE::RenderBackend.

Definition at line 85 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::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 201 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::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 170 of file renderbackendopengl.cpp.

Image * FIFE::RenderBackendOpenGL::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 90 of file renderbackendopengl.cpp.

References setScreenMode().

Disable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 333 of file renderbackendopengl.cpp.

Disable the lighting.

Implements FIFE::RenderBackend.

Definition at line 231 of file renderbackendopengl.cpp.

Referenced by setLightingModel().

Here is the caller graph for this function:

Disable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 270 of file renderbackendopengl.cpp.

Referenced by resetLighting().

Here is the caller graph for this function:

Enable the alpha test.

Implements FIFE::RenderBackend.

Definition at line 326 of file renderbackendopengl.cpp.

Referenced by setAlphaTest().

Here is the caller graph for this function:

Enable the lighting.

Implements FIFE::RenderBackend.

Definition at line 224 of file renderbackendopengl.cpp.

Referenced by setLightingModel().

Here is the caller graph for this function:

Enable the stencil test.

Implements FIFE::RenderBackend.

Definition at line 263 of file renderbackendopengl.cpp.

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

Implements FIFE::RenderBackend.

Definition at line 166 of file renderbackendopengl.cpp.

unsigned int FIFE::RenderBackendOpenGL::getLightingModel ( ) const [virtual]

Gets the current light model.

Implements FIFE::RenderBackend.

Definition at line 220 of file renderbackendopengl.cpp.

const std::string & FIFE::RenderBackendOpenGL::getName ( ) const [virtual]

The name of the renderbackend.

Returns:
The name of this renderbackend.

Implements FIFE::RenderBackend.

Definition at line 62 of file renderbackendopengl.cpp.

uint8_t FIFE::RenderBackendOpenGL::getStencilRef ( ) const [virtual]

Return the reference value for the stencil test.

Implements FIFE::RenderBackend.

Definition at line 322 of file renderbackendopengl.cpp.

void FIFE::RenderBackendOpenGL::init ( const std::string &  driver) [virtual]

Initializes the backend.

Implements FIFE::RenderBackend.

Definition at line 71 of file renderbackendopengl.cpp.

Reset lighting with default values.

Implements FIFE::RenderBackend.

Definition at line 250 of file renderbackendopengl.cpp.

References disableStencilTest(), and setLighting().

void FIFE::RenderBackendOpenGL::setAlphaTest ( float  ref_alpha) [virtual]

Set reference for the alpha test.

Implements FIFE::RenderBackend.

Definition at line 340 of file renderbackendopengl.cpp.

References enableAlphaTest().

void FIFE::RenderBackendOpenGL::setLighting ( float  red,
float  green,
float  blue,
float  alpha 
) [virtual]

Set colors for lighting

Implements FIFE::RenderBackend.

Definition at line 238 of file renderbackendopengl.cpp.

Referenced by resetLighting().

Here is the caller graph for this function:

void FIFE::RenderBackendOpenGL::setLightingModel ( unsigned int  lighting) [virtual]

Initializes the light.

Implements FIFE::RenderBackend.

Definition at line 205 of file renderbackendopengl.cpp.

References disableLighting(), and enableLighting().

Image * FIFE::RenderBackendOpenGL::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 105 of file renderbackendopengl.cpp.

Referenced by createMainScreen().

Here is the caller graph for this function:

Called when a new frame starts.

Implements FIFE::RenderBackend.

Definition at line 163 of file renderbackendopengl.cpp.


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