Public Member Functions | Protected Member Functions

FIFE::RenderBackendOpenGLe Class Reference

#include <renderbackendopengle.h>

Inheritance diagram for FIFE::RenderBackendOpenGLe:
Inheritance graph
[legend]
Collaboration diagram for FIFE::RenderBackendOpenGLe:
Collaboration graph
[legend]

List of all members.

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 ImagecreateImage (const uint8_t *data, uint32_t width, uint32_t height)
virtual ImagecreateImage (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 ()

Protected Member Functions

virtual void setClipArea (const Rect &cliparea, bool clear)

Detailed Description

The main class of the OpenGL-based experimental renderer.

See also:
RenderBackend

Definition at line 42 of file renderbackendopengle.h.


Member Function Documentation

void FIFE::RenderBackendOpenGLe::addImageToArray ( uint32_t  id,
const Rect rec,
float const *  st,
uint8_t  alpha,
uint8_t const *  rgb 
) [virtual]

Add the Image data to the array

Implements FIFE::RenderBackend.

Definition at line 1055 of file renderbackendopengle.cpp.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

Referenced by attachRenderTarget().

Here is the caller graph for this function:

void FIFE::RenderBackendOpenGLe::attachRenderTarget ( ImagePtr img,
bool  discard 
) [virtual]

Attaches given image as a new render surface

Implements FIFE::RenderBackend.

Definition at line 1449 of file renderbackendopengle.cpp.

References addImageToArray(), and FIFE::SharedPtr< T >::get().

void FIFE::RenderBackendOpenGLe::captureScreen ( const std::string &  filename  )  [virtual]

Creates a Screenshot and saves it to a file.

Implements FIFE::RenderBackend.

Definition at line 1290 of file renderbackendopengle.cpp.

References FIFE::Image::saveAsPng().

Referenced by captureScreen().

Here is the caller graph for this function:

void FIFE::RenderBackendOpenGLe::captureScreen ( const std::string &  filename,
uint32_t  width,
uint32_t  height 
) [virtual]

Creates a Screenshot with the given size(w,h) and saves it to a file.

Implements FIFE::RenderBackend.

Definition at line 1324 of file renderbackendopengle.cpp.

References captureScreen(), and FIFE::Image::saveAsPng().

void FIFE::RenderBackendOpenGLe::changeBlending ( int32_t  scr,
int32_t  dst 
) [virtual]

Change the Blendingmodel.

Implements FIFE::RenderBackend.

Definition at line 522 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::changeRenderInfos ( uint16_t  elements,
int32_t  src,
int32_t  dst,
bool  light,
bool  stentest,
uint8_t  stenref,
GLConstants  stenop,
GLConstants  stenfunc 
) [virtual]

Dirty helper function to change the render infos

Implements FIFE::RenderBackend.

Definition at line 559 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::clearBackBuffer (  )  [virtual]

Forces a clear of the backbuffer

Implements FIFE::RenderBackend.

Definition at line 132 of file renderbackendopengle.cpp.

Image * FIFE::RenderBackendOpenGLe::createImage ( const uint8_t *  data,
uint32_t  width,
uint32_t  height 
) [virtual]

Creates an Image suitable for this renderbackend.

Parameters:
data Pointer to the imagedata (needs to be in RGBA, 8 bits per channel).
width Width of the image.
height Height of the image.
Returns:
The new Image.

Implements FIFE::RenderBackend.

Definition at line 320 of file renderbackendopengle.cpp.

Image * FIFE::RenderBackendOpenGLe::createImage ( SDL_Surface *  surface  )  [virtual]

Helper function to create images from SDL_Surfaces. Takes ownership over the surface.

Parameters:
surface The surface to convert.
Returns:
The new Image.

Implements FIFE::RenderBackend.

Definition at line 252 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::createMainScreen ( const ScreenMode &  mode,
const std::string &  title,
const std::string &  icon 
) [virtual]

Creates the mainscreen (the display window).

Parameters:
mode The ScreenMode to use.
See also:
FIFE::ScreenMode.
Parameters:
tite The window title to use.
icon The window icon to use.

Implements FIFE::RenderBackend.

Definition at line 138 of file renderbackendopengle.cpp.

References setScreenMode().

void FIFE::RenderBackendOpenGLe::detachRenderTarget (  )  [virtual]

Detaches current render surface

Implements FIFE::RenderBackend.

Definition at line 1501 of file renderbackendopengle.cpp.

References FIFE::SharedPtr< T >::get(), and renderVertexArrays().

void FIFE::RenderBackendOpenGLe::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]

Draws a light primitive that based on a triangle fan

Implements FIFE::RenderBackend.

Definition at line 1025 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::drawLine ( const Point p1,
const Point p2,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Draws line between given points with given RGBA

Implements FIFE::RenderBackend.

Definition at line 891 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::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]

Draws quad between given points with given RGBA

Implements FIFE::RenderBackend.

Definition at line 976 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::drawRectangle ( const Point p,
uint16_t  w,
uint16_t  h,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Draws an axis parallel rectangle.

Implements FIFE::RenderBackend.

Definition at line 931 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::drawTriangle ( const Point p1,
const Point p2,
const Point p3,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Draws triangle between given points with given RGBA

Implements FIFE::RenderBackend.

Definition at line 909 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::drawVertex ( const Point p,
const uint8_t  size,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Draws a quad that represents a vertex with given RGBA

Implements FIFE::RenderBackend.

Definition at line 1002 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::endFrame (  )  [virtual]

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

Reimplemented from FIFE::RenderBackend.

Definition at line 239 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::fillRectangle ( const Point p,
uint16_t  w,
uint16_t  h,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Draws a filled axis parallel rectangle.

Implements FIFE::RenderBackend.

Definition at line 953 of file renderbackendopengle.cpp.

uint32_t FIFE::RenderBackendOpenGLe::getLightingModel (  )  const [virtual]

Gets the current light model.

Implements FIFE::RenderBackend.

Definition at line 344 of file renderbackendopengle.cpp.

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

The name of the renderbackend.

Returns:
The name of this renderbackend.

Implements FIFE::RenderBackend.

Definition at line 116 of file renderbackendopengle.cpp.

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

Initializes the backend.

Implements FIFE::RenderBackend.

Definition at line 121 of file renderbackendopengle.cpp.

bool FIFE::RenderBackendOpenGLe::putPixel ( int32_t  x,
int32_t  y,
uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
) [virtual]

Writes pixel to given position. Returns true, if pixel was written (not out of bounds)

Implements FIFE::RenderBackend.

Definition at line 871 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::renderVertexArrays (  )  [virtual]

Render the Vertex Arrays, only for primitives (points, lines,...)

Implements FIFE::RenderBackend.

Definition at line 580 of file renderbackendopengle.cpp.

Referenced by detachRenderTarget().

Here is the caller graph for this function:

void FIFE::RenderBackendOpenGLe::resetLighting (  )  [virtual]

Reset lighting with default values.

Implements FIFE::RenderBackend.

Definition at line 420 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::resetStencilBuffer ( uint8_t  buffer  )  [virtual]

Reset stencil buffer with given value.

Implements FIFE::RenderBackend.

Definition at line 452 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::setClipArea ( const Rect cliparea,
bool  clear 
) [protected, virtual]

Sets given clip area into image

See also:
pushClipArea

Implements FIFE::RenderBackend.

Definition at line 1435 of file renderbackendopengle.cpp.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

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

Set colors for lighting

Implements FIFE::RenderBackend.

Definition at line 413 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::setLightingModel ( uint32_t  lighting  )  [virtual]

Initializes the light.

Implements FIFE::RenderBackend.

Definition at line 328 of file renderbackendopengle.cpp.

void FIFE::RenderBackendOpenGLe::setScreenMode ( const ScreenMode &  mode  )  [virtual]

Sets the mainscreen display mode.

Parameters:
mode The ScreenMode to change the display to.
See also:
FIFE::ScreenMode.

Implements FIFE::RenderBackend.

Definition at line 151 of file renderbackendopengle.cpp.

Referenced by createMainScreen().

Here is the caller graph for this function:

void FIFE::RenderBackendOpenGLe::startFrame (  )  [virtual]

Called when a new frame starts.

Reimplemented from FIFE::RenderBackend.

Definition at line 235 of file renderbackendopengle.cpp.


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