Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

peon::SceneRenderer Class Reference

This object is responsible for processing our rendering commands to the underlying video hardware. More...

#include <SceneRenderer.h>

Inheritance diagram for peon::SceneRenderer:

peon::IUnknown List of all members.

Public Member Functions

 SceneRenderer ()
 Constructor.
 ~SceneRenderer ()
 Destructor.
bool loadDevice (IniConfigReader *pConfig)
 This method loads our configuration settings in order to prepare our rendering context.
void unloadDevice ()
 This method deallocated and cleans up our surfaces.
bool clearDevice ()
 This method clears the back buffer and prepares it for us to send rendering commands to.
void flipDevice ()
 This method is responsible for swapping our back buffer with the front one...thereby rendering a new screen.
void drawPrim (DiffusePrim *pVertices, int count)
 This method takes in an array of vertices and renders them to our context.
void drawPrim (DiffuseTexPrim *pVertices, int count)
 This method takes in an array of vertices and renders them to our context.
void drawPrim (NormalDiffuseTexPrim *pVertices, int count)
 This method takes in an array of vertices and renders them to our context.
void drawQuads (NormalDiffuseTexPrim *pVertices, int count)
 This method takes in an array of vertices and renders them to our context.
void setLight (int light_slot, const SceneLight &oLight)
 This method simply sets a set of lighting states within our scene depending upon the parameters.
SceneTextureloadTexture (const String &strFilename, bool bAlpha=true, bool bMipMaps=true, bool bRepeat=false)
 This method is responsible for loading an image into the texture memory of your device.
SceneFontloadFont (int char_width=16, int char_height=16, int char_spacing=10)
 This method is responsible for loading a font object into a SceneFont handle.
SceneCameragetActiveCamera ()
 This method just returns our active camera.
int getWidth ()
 Gets the width of our device.
int getHeight ()
 Gets the height of our device.
bool isExtensionSupported (const String &strExtension)
 Check to see if an extension is supported.
void getScreenCapture ()
 This method is responsible for taking screen captures.
void getProjectionMatrix (Matrix44 &pMat)
 This method simply fills a Matrix44 object with the current projection matrix.
void getModelViewMatrix (Matrix44 &pMat)
 This method simply fills a Matrix44 object with the current modelview matrix.

Protected Attributes

SDL_Surface * m_pOGLSurface
 OpenGL rendering surface.
int m_iDeviceWidth
 surface width
int m_iDeviceHeight
 surface height
int m_iBitsPerPixel
 surface bits-per-pixel
bool m_bWindowed
 windowed or fullscreen?
SceneCameram_pActiveCamera
 our current SceneCamera object
SceneLight m_oLights [MAX_LIGHTS]
 an array of SceneLight objects.

Detailed Description

This object is responsible for processing our rendering commands to the underlying video hardware.

Rather than spread a whole bunch of API specific code in our actual game, it'd be nice to just command this object to do the work for us.


Member Function Documentation

bool peon::SceneRenderer::clearDevice  ) 
 

This method clears the back buffer and prepares it for us to send rendering commands to.

Returns:
bool - always true

void peon::SceneRenderer::drawPrim NormalDiffuseTexPrim pVertices,
int  count
 

This method takes in an array of vertices and renders them to our context.

Parameters:
pVertices - array of NormalDiffuseTexPrim objects
count - count of NormalDiffuseTexPrim objects in array

void peon::SceneRenderer::drawPrim DiffuseTexPrim pVertices,
int  count
 

This method takes in an array of vertices and renders them to our context.

Parameters:
pVertices - array of DiffuseTexPrim objects
count - count of DiffuseTexPrim objects in array

void peon::SceneRenderer::drawPrim DiffusePrim pVertices,
int  count
 

This method takes in an array of vertices and renders them to our context.

Parameters:
pVertices - array of DiffusePrim objects
count - count of DiffusePrim objects in array

void peon::SceneRenderer::drawQuads NormalDiffuseTexPrim pVertices,
int  count
 

This method takes in an array of vertices and renders them to our context.

Parameters:
pVertices - array of NormalDiffuseTexPrim objects
count - count of NormalDiffuseTexPrim objects in array

SceneCamera* peon::SceneRenderer::getActiveCamera  )  [inline]
 

This method just returns our active camera.

Returns:
SceneCamera* - handle to our SceneCamera

int peon::SceneRenderer::getHeight  )  [inline]
 

Gets the height of our device.

Returns:
int - device height

void peon::SceneRenderer::getModelViewMatrix Matrix44 pMat  ) 
 

This method simply fills a Matrix44 object with the current modelview matrix.

Parameters:
pMat - handle to our Matrix44 object

void peon::SceneRenderer::getProjectionMatrix Matrix44 pMat  ) 
 

This method simply fills a Matrix44 object with the current projection matrix.

Parameters:
pMat - handle to our Matrix44 object

int peon::SceneRenderer::getWidth  )  [inline]
 

Gets the width of our device.

Returns:
int - device width

bool peon::SceneRenderer::isExtensionSupported const String &  strExtension  ) 
 

Check to see if an extension is supported.

Parameters:
strExtension - string object containing extension name
Returns:
bool - true if it does, false otherwise

bool peon::SceneRenderer::loadDevice IniConfigReader pConfig  ) 
 

This method loads our configuration settings in order to prepare our rendering context.

Parameters:
pConfig - IniConfigReader object
Returns:
bool - true or false

SceneFont* peon::SceneRenderer::loadFont int  char_width = 16,
int  char_height = 16,
int  char_spacing = 10
 

This method is responsible for loading a font object into a SceneFont handle.

Parameters:
char_width - pixel width of each character
char_height - pixel height of each character
char_spacing - spacing in pixels between character
Returns:
SceneFont* - handle to our created SceneFont

SceneTexture* peon::SceneRenderer::loadTexture const String &  strFilename,
bool  bAlpha = true,
bool  bMipMaps = true,
bool  bRepeat = false
 

This method is responsible for loading an image into the texture memory of your device.

Parameters:
strFilename - the path to the image file
bAlpha - do we have an alpha channel?
bMipMaps - do we create mipmaps?
bRepeat - do we repeat the texture?
Returns:
SceneTexture* - pointer to the created SceneTexture object

void peon::SceneRenderer::setLight int  light_slot,
const SceneLight oLight
 

This method simply sets a set of lighting states within our scene depending upon the parameters.

Parameters:
light_slot - which slot we wish to affect
oLight - our SceneLight object


The documentation for this class was generated from the following file:
Generated on Thu Dec 1 01:55:41 2005 for Peon by  doxygen 1.4.1