GlRenderer Class Reference

#include <GlRenderer.h>

Inheritance diagram for GlRenderer:

Object

List of all members.

Public Member Functions

 GlRenderer ()
 Standard constructor.
 ~GlRenderer ()
 Standard destructor.
void renderGl (const Uint32 &time, Camera &camera)
 Draw the geometry.
void initGl ()
 Initialize OpenGL state.
void resizeGl (int width, int height)
 Handle window resizing.
void checkExtensions ()
 check Existence of extensions on start-up
void registerObject (Object2d *element)
 Register a new element for the overlay.
void registerObject (PhongLight *element)
 Register a new element as light.
void registerObject (Object3d *element)
 Register a new element for the scene.
void unregisterObject (Object3d *element)
 Unregister an element for the scene.
void unregisterObject (Object2d *element)
 Unregister an element for the overlay.
void addPictureInPicture (Camera *camera, GLuint x, GLuint y, GLuint width, GLuint height)
 Adds a picture-in-picture view.
void updatePictureInPicture (Camera *camera, GLuint x, GLuint y, GLuint width, GLuint height)
 Updates a picture-in-picture view with new coordinates.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Private Member Functions

void beginParallelGl ()
 switch to parallel rendering mode
void endParallelGl ()
 leave parallel rendering mode
void draw3dGl (const Uint32 &time, Camera &camera, GLuint width, GLuint height, GLfloat pixelratio)
 Draw 3d-image.
void draw2dGl (const Uint32 &time)
 Draw 2d-overlay.
GLuint selectGl (GLuint x, GLuint y, Camera &camera)
 Draw geometry in selection mode.

Private Attributes

GLint width
 The width of the viewport.
GLint height
 The height of the viewport.
GLfloat pixelRatio
 The aspect ratio of a pixel.
vector< Object3d * > objects3d
 The list of 3d objects to be rendered.
vector< Object2d * > objects2d
 The list of 2d objects to be rendered.
vector< PhongLight * > lights
 The list of lights in the scene.
FboframebufferScene
 Framebuffer for scene rendering.
vector< struct PipView * > pipViews
 picture in picture views
glExtensions ext
 Indicates support for OpenGL extensions.


Constructor & Destructor Documentation

GlRenderer::GlRenderer (  ) 

Standard constructor.

GlRenderer::~GlRenderer (  ) 

Standard destructor.


Member Function Documentation

void GlRenderer::beginParallelGl (  )  [private]

switch to parallel rendering mode

After this call, the perspective projection will be ignored. The Y-Axis is turned upside-down (inverted) and the origin is moved to the top left corner. of the viewport.

void GlRenderer::endParallelGl (  )  [private]

leave parallel rendering mode

Restores the perspective projection and the origin after parallel rendering.

void GlRenderer::draw3dGl ( const Uint32 &  time,
Camera camera,
GLuint  width,
GLuint  height,
GLfloat  pixelRatio 
) [private]

Draw 3d-image.

The 3d-portion of the image is being drawn

void GlRenderer::draw2dGl ( const Uint32 &  time  )  [private]

Draw 2d-overlay.

All 2d-overlay elements for the frame are being drawn

GLuint GlRenderer::selectGl ( GLuint  x,
GLuint  y,
Camera camera 
) [private]

Draw geometry in selection mode.

All operations that have to be executed each frame for object picking. Coordinates are processed in window coordinates with a origin in the top left corner.

Parameters:
x The x coordinate at which to pick
y The y coordinate at which to pick
Returns:
The id of the picked object

void GlRenderer::renderGl ( const Uint32 &  time,
Camera camera 
)

Draw the geometry.

All operations that have to be executed each frame e.g. draw the geometry.

void GlRenderer::initGl (  ) 

Initialize OpenGL state.

Manages all operations that have to be done on initializing the renderer.

void GlRenderer::resizeGl ( int  width,
int  height 
)

Handle window resizing.

Manages all operations on resize.

Parameters:
width The new framebuffer width
height The new framebuffer height

void GlRenderer::checkExtensions (  ) 

check Existence of extensions on start-up

Checks for extension support. This is only called once during window initialization. Findings are saved a glExtensions struct.

See also:
GLWindow

glExtensions

void GlRenderer::registerObject ( Object2d element  ) 

Register a new element for the overlay.

Registeres an object2d element to be interpreted by the renderer. If the element is already registered by the renderer, this call will have no effect.

Parameters:
element The new element to be added to the GUI

void GlRenderer::registerObject ( PhongLight element  ) 

Register a new element as light.

Registeres a Phong Light element to be interpreted by the renderer. If the element is already registered by the renderer or eight lights have been registered, this call will have no effect.

Parameters:
element The new light to be added to the Scene

void GlRenderer::registerObject ( Object3d element  ) 

Register a new element for the scene.

Registeres an object3d element to be interpreted by the renderer. If the element is already registered by the renderer, this call will have no effect.

Parameters:
element The new element to be added to the Scene

void GlRenderer::unregisterObject ( Object3d element  ) 

Unregister an element for the scene.

void GlRenderer::unregisterObject ( Object2d element  ) 

Unregister an element for the overlay.

void GlRenderer::addPictureInPicture ( Camera camera,
GLuint  x,
GLuint  y,
GLuint  width,
GLuint  height 
)

Adds a picture-in-picture view.

void GlRenderer::updatePictureInPicture ( Camera camera,
GLuint  x,
GLuint  y,
GLuint  width,
GLuint  height 
)

Updates a picture-in-picture view with new coordinates.

string GlRenderer::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Reimplemented from Object.

string GlRenderer::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Reimplemented from Object.

enum classId GlRenderer::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Reimplemented from Object.


Member Data Documentation

GLint GlRenderer::width [private]

The width of the viewport.

GLint GlRenderer::height [private]

The height of the viewport.

GLfloat GlRenderer::pixelRatio [private]

The aspect ratio of a pixel.

vector<Object3d*> GlRenderer::objects3d [private]

The list of 3d objects to be rendered.

vector<Object2d*> GlRenderer::objects2d [private]

The list of 2d objects to be rendered.

vector<PhongLight*> GlRenderer::lights [private]

The list of lights in the scene.

Framebuffer for scene rendering.

vector<struct PipView*> GlRenderer::pipViews [private]

picture in picture views

Indicates support for OpenGL extensions.


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

Generated on Mon Jul 7 13:30:34 2008 for Firefly by  doxygen 1.5.6