Gel2D - The free/open source game creation suite

Public Member Functions | Protected Attributes
gel::GelRenderSystem Class Reference

Abstract render system. More...

#include <gelRenderSystem.h>

List of all members.

Public Member Functions

 GelRenderSystem ()
 Constructor.
virtual ~GelRenderSystem ()
 Destructor.
RenderAPI getType () const
 Gets the low-level API that is used for rendering.
virtual void beginScene ()
 Begins rendering the scene.
virtual void endScene ()
 Finishes rendering the scene.
virtual void setViewport (GelViewport vp)
 Sets the viewport to use for rendering.
virtual GelViewport const getViewport ()
 Gets the active viewport.
virtual void updateViewport ()
 Updates the viewport for the low-level API.
virtual void setActiveCamera (GelCamera *cam)
virtual void setClearColor (GelColor col)
 Sets the color to use when clearing the color buffer.
virtual void clearBuffers (bool color, bool depth, bool stencil)
 Clears the requested buffers.
virtual void drawArrays (int mode, int start, int count)
 Draws arrays.
virtual void transformView (const Gel3x3Matrix &mat)
virtual void transformWorld (const Gel3x3Matrix &mat)
virtual void transformModel (const Gel3x3Matrix &mat)
virtual Gel2dVec getWorldCoords (int x, int y)
 Converts screen coordinates to world coordinates.
virtual void takeScreenshot (const char *filename, ImageType ff, ColorMode cmode)
 Saves a screenshot of the pixel buffer to the specified file.

Protected Attributes

RenderAPI type
GelViewport activeViewport
GelCameraactiveCamera

Detailed Description

Abstract render system.


Constructor & Destructor Documentation

gel::GelRenderSystem::GelRenderSystem ( )

Constructor.

virtual gel::GelRenderSystem::~GelRenderSystem ( ) [virtual]

Destructor.


Member Function Documentation

RenderAPI gel::GelRenderSystem::getType ( ) const [inline]

Gets the low-level API that is used for rendering.

virtual void gel::GelRenderSystem::beginScene ( ) [virtual]

Begins rendering the scene.

This must be called before rendering any objects.

virtual void gel::GelRenderSystem::endScene ( ) [virtual]

Finishes rendering the scene.

This must be called after all objects have been rendered.

virtual void gel::GelRenderSystem::setViewport ( GelViewport  vp) [virtual]

Sets the viewport to use for rendering.

virtual GelViewport const gel::GelRenderSystem::getViewport ( ) [inline, virtual]

Gets the active viewport.

virtual void gel::GelRenderSystem::updateViewport ( ) [virtual]

Updates the viewport for the low-level API.

You should never need to call this function.
It is here for internal use.

virtual void gel::GelRenderSystem::setActiveCamera ( GelCamera cam) [inline, virtual]
virtual void gel::GelRenderSystem::setClearColor ( GelColor  col) [virtual]

Sets the color to use when clearing the color buffer.

virtual void gel::GelRenderSystem::clearBuffers ( bool  color,
bool  depth,
bool  stencil 
) [virtual]

Clears the requested buffers.

Parameters:
color: Clears the color buffer.
depth: Clears the depth buffer.
stencil: Clears the stencil buffer.
virtual void gel::GelRenderSystem::drawArrays ( int  mode,
int  start,
int  count 
) [virtual]

Draws arrays.

This function doesn't work yet.

virtual void gel::GelRenderSystem::transformView ( const Gel3x3Matrix mat) [virtual]
virtual void gel::GelRenderSystem::transformWorld ( const Gel3x3Matrix mat) [virtual]
virtual void gel::GelRenderSystem::transformModel ( const Gel3x3Matrix mat) [virtual]
virtual Gel2dVec gel::GelRenderSystem::getWorldCoords ( int  x,
int  y 
) [virtual]

Converts screen coordinates to world coordinates.

virtual void gel::GelRenderSystem::takeScreenshot ( const char *  filename,
ImageType  ff,
ColorMode  cmode 
) [virtual]

Saves a screenshot of the pixel buffer to the specified file.

It currently can only save images in TGA and PNG formats.
Please note that this function will save whatever state the buffer is in at the time it is called; usually, this means you'll want to call it after the entire scene has been rendered.

Parameters:
filename: The directory and name of the screenshot.
ff: The image type to save as.
cmode: The color mode to save the image in.

Member Data Documentation


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