[AE Engine logo] Public API Reference
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

aeOpenGLRenderer Class Reference

OpenGL rendering system. More...

#include <ogl_renderer.h>

Inheritance diagram for aeOpenGLRenderer:

aeRenderer aePlugin aeBase List of all members.

Public Member Functions

 aeOpenGLRenderer (aeRegistry *reg, bool fullscreen, int winWidth, int winHeight, int winBpp)
 Create a new OpenGL renderer instance.

void initialize ()
 Initialize the rendering system.

void reinitialize ()
 Re-initialize the rendering system.

void shutdown ()
 Shutdown the rendering system.

bool createWindow ()
 Create a rendering window.

void closeWindow ()
 Close a rendering window.

void setOptions (aeRendererOptions &ropts, bool reinitialize=false)
 Set rendering options.

void setShadeMode (aeShadeMode sm)
 Set primitive shading mode (flat or smooth shading).

aeShadeMode getShadeMode () const
 Get primitive shading mode.

void addViewport (aeViewport *vp, bool becomesActive=false)
 Add a new viewport.

void removeViewport (const char *vpName)
 Remove a viewport given its name.

void removeAllViewports ()
 Remove all viewports.

aeViewport findViewportByName (const char *vpName) const
 Find a viewport by name.

aeViewport getActiveViewport () const
 Get the active viewport.

void _flushPipeline ()
 Flush the rendering pipeline.

void _setActiveTextureUnit (int texUnit)
 Set the active texture unit.

int _getActiveTextureUnit () const
 Get the currently active texture unit.

void _setTextureParams (aeRendererUnit targetTex, aeTextureFilterMode tfMode, aeTextureEnvironment texEnv)
 Set all texture parameters in one call.

void _setTextureFilter (aeRendererUnit targetTex, aeTextureFilterMode tfMode)
 Set texture filtering mode (none, bilinear, or trilinear).

aeTextureFilterMode _getTextureFilter (aeRenderUnit targetTex) const
 Get the texture filtering mode for specified target texture.

void _setTextureEnvironment (aeTextureEnvironment texEnv)
 Set the texture environment parameters.

aeTextureEnvironment _getTextureEnvironment () const
 Get the current texture environment parameters.

void _setDepthBufferParams (bool depthTest, bool depthWrite, aeDepthBufferFunc depthFunc)
 Set depth buffer parameters.

void _setDepthBufferTest (bool depthTest)
 Enable/disable depth testing.

bool _getDepthBufferTest () const
 Check if depth testing is on or off.

void _setDepthBufferWrite (bool depthWrite)
 Enable/disable writing to depth buffer.

bool _getDepthBufferWrite () const
 Check if the depth buffer is writable or not.

void _setDepthBufferFunction (aeDepthBufferFunc depthFunc)
 Set depth buffer comparison function.

aeDepthBufferFunc _getDepthBufferFunction () const
 Get the current depth buffer comparison function.

void _setBlendFunction (aeBlendFunc src, aeBlendFunc dest)
 Set the blending parameters.

void _setWorldMatrix (const aeMatrix4 &worldMat)
 Replace the current world transform matrix in the world matrix stack.

void _setViewMatrix (const aeMatrix4 &viewMat)
 Replace the current view transform matrix in the view matrix stack.

void _setProjectionMatrix (const aeMatrix4 &projMat)
 Replace the current projection transform matrix in the projection matrix stack.

void _pushWorldMatrix ()
 Push (copy) the current world transform matrix down one level in the world matrix stack.

void _pushViewMatrix ()
 Push (copy) the current view transform matrix down one level in the view matrix stack.

void _pushProjectionMatrix ()
 Push (copy) the current projection transform matrix down one level in the projection matrix stack.

void _popWorldMatrix ()
 Pop (destroy) the current world transform matrix in the world matrix stack.

void _popViewMatrix ()
 Pop (destroy) the current view transform matrix in the view matrix stack.

void _popProjectionMatrix ()
 Pop (destroy) the current projection transform matrix in the projection matrix stack.

void _prepareFrame ()
 Prepare for rendering a frame.

void _render (aeRenderOperation &renderOp)
 Issue a rendering operation on the active viewport.

void _finishFrame ()
 Finish rendering a frame.


Private Member Functions

aeDepthBufferFunc convertOpenGLDepthBufferFunc2AE (GLint depthFunc) const
 Converts OpenGL depth buffer function to aeDepthBufferFunc.

GLint convertaeDepthBufferFunc2OpenGL (aeDepthBufferFunc depthFunc) const
 Converts aeDepthBufferFunc to OpenGL depth buffer function.


Detailed Description

OpenGL rendering system.

This is the AE OpenGL rendering system. It implements the general 3D API interface defined in aeRenderer.

See also:
aeRenderer, aeDirect3D9Renderer.

Definition at line 43 of file ogl_renderer.h.


Constructor & Destructor Documentation

aeOpenGLRenderer::aeOpenGLRenderer aeRegistry   reg,
bool    fullscreen,
int    winWidth,
int    winHeight,
int    winBpp
 

Create a new OpenGL renderer instance.

The parameters are sent to aeRenderer to give the rendererOpts initial values.

Parameters:
fullscreen Enable/disable fullscreen window.
winWidth Window width.
winHeight Window height.
winBpp Window bits per pixel.


Member Function Documentation

void aeOpenGLRenderer::_finishFrame   [virtual]
 

Finish rendering a frame.

This is called by aeEngine::render() (and before aecmdPostFrame event) after rendering a frame.

Implements aeRenderer.

void aeOpenGLRenderer::_flushPipeline   [virtual]
 

Flush the rendering pipeline.

This causes the renderer to flush the rendering pipeline causing all pending buffers to be emptied and remaining commands executed. This is very similiar to the OpenGL glFlush command.

Implements aeRenderer.

int aeOpenGLRenderer::_getActiveTextureUnit   const [virtual]
 

Get the currently active texture unit.

Returns:
The active texture unit.

Implements aeRenderer.

aeDepthBufferFunc aeOpenGLRenderer::_getDepthBufferFunction   const [virtual]
 

Get the current depth buffer comparison function.

Returns:
The current depth buffer comparison function.

Implements aeRenderer.

bool aeOpenGLRenderer::_getDepthBufferTest   const [virtual]
 

Check if depth testing is on or off.

Returns:
True if depth testing is enabled, false if not.

Implements aeRenderer.

bool aeOpenGLRenderer::_getDepthBufferWrite   const [virtual]
 

Check if the depth buffer is writable or not.

Returns:
True if the depth buffer is writable, false if not.

Implements aeRenderer.

aeTextureEnvironment aeOpenGLRenderer::_getTextureEnvironment   const [virtual]
 

Get the current texture environment parameters.

Returns:
The current texture environment parameter.
See also:
aeTextureEnvironment.

Implements aeRenderer.

aeTextureFilterMode aeOpenGLRenderer::_getTextureFilter aeRenderUnit    targetTex const
 

Get the texture filtering mode for specified target texture.

Parameters:
targetTex Target texture. Must be one of AE_TEXTURE_1D, AE_TEXTURE_2D, or AE_TEXTURE_3D.
Returns:
The texture filtering mode for targetTex.
See also:
aeTextureFilterMode, aeRendererUnit.

void aeOpenGLRenderer::_popProjectionMatrix   [virtual]
 

Pop (destroy) the current projection transform matrix in the projection matrix stack.

This replaces the current projection transform matrix with the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_popViewMatrix   [virtual]
 

Pop (destroy) the current view transform matrix in the view matrix stack.

This replaces the current view transform matrix with the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_popWorldMatrix   [virtual]
 

Pop (destroy) the current world transform matrix in the world matrix stack.

This replaces the current world transform matrix with the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_prepareFrame   [virtual]
 

Prepare for rendering a frame.

This is called by aeEngine::render() (and after aecmdPreFrame event) before actually drawing the frame.

Implements aeRenderer.

void aeOpenGLRenderer::_pushProjectionMatrix   [virtual]
 

Push (copy) the current projection transform matrix down one level in the projection matrix stack.

This means that after this call the matrix on top of the projection matrix stack is identical to the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_pushViewMatrix   [virtual]
 

Push (copy) the current view transform matrix down one level in the view matrix stack.

This means that after this call the matrix on top of the view matrix stack is identical to the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_pushWorldMatrix   [virtual]
 

Push (copy) the current world transform matrix down one level in the world matrix stack.

This means that after this call the matrix on top of the world matrix stack is identical to the one below it.

Implements aeRenderer.

void aeOpenGLRenderer::_render aeRenderOperation   renderOp [virtual]
 

Issue a rendering operation on the active viewport.

This is used by the engine to do any graphics rendering on the screen.

The advanced API user can use this method to build his/her own rendering operations to achieve greater control over the rendering process and the 3D API.

Parameters:
renderOp Rendering operation to execute.
See also:
aeRenderOperation.

Implements aeRenderer.

void aeOpenGLRenderer::_setActiveTextureUnit int    texUnit [virtual]
 

Set the active texture unit.

Parameters:
texUnit Texture unit to activate.

Implements aeRenderer.

void aeOpenGLRenderer::_setBlendFunction aeBlendFunc    src,
aeBlendFunc    dest
[virtual]
 

Set the blending parameters.

Parameters:
src Blend parameter for source color. See aeBlendFunc for possible values.
dest Blend parameter for destination color. See aeBlendFunc for possible values.
See also:
aeBlendFunc.

Implements aeRenderer.

void aeOpenGLRenderer::_setDepthBufferFunction aeDepthBufferFunc    depthFunc [virtual]
 

Set depth buffer comparison function.

See aeDepthBufferFunc for possible values.

Parameters:
depthFunc Depth comparison function.

Implements aeRenderer.

void aeOpenGLRenderer::_setDepthBufferParams bool    depthTest,
bool    depthWrite,
aeDepthBufferFunc    depthFunc
[virtual]
 

Set depth buffer parameters.

This allows to set all the parameters in one call.

Parameters:
depthWrite Enable/disable writing to depth buffer.
depthFunc Depth comparison function. See aeDepthBufferFunc for possible values.
See also:
aeDepthBufferFunc.

Implements aeRenderer.

void aeOpenGLRenderer::_setDepthBufferTest bool    depthTest [virtual]
 

Enable/disable depth testing.

Parameters:
depthTest Enable/disable depth testing.

Implements aeRenderer.

void aeOpenGLRenderer::_setDepthBufferWrite bool    depthWrite [virtual]
 

Enable/disable writing to depth buffer.

Parameters:
flag Enable/disable depth buffer write.

Implements aeRenderer.

void aeOpenGLRenderer::_setProjectionMatrix const aeMatrix4   projMat [virtual]
 

Replace the current projection transform matrix in the projection matrix stack.

Parameters:
worldMat New projection transform matrix.

Implements aeRenderer.

void aeOpenGLRenderer::_setTextureEnvironment aeTextureEnvironment    texEnv [virtual]
 

Set the texture environment parameters.

Parameters:
texEnv Texture environment. See aeTextureEnvironment for possible values.
See also:
aeTextureEnvironment.

Implements aeRenderer.

void aeOpenGLRenderer::_setTextureFilter aeRendererUnit    targetTex,
aeTextureFilterMode    tfMode
 

Set texture filtering mode (none, bilinear, or trilinear).

Parameters:
targetTex Target texture. Must be one of AE_TEXTURE_1D, AE_TEXTURE_2D, or AE_TEXTURE_3D.
tfMode Texture filtering mode. See aeTextureFilterMode for possible values.
See also:
aeTextureFilterMode, aeRendererUnit.

void aeOpenGLRenderer::_setTextureParams aeRendererUnit    targetTex,
aeTextureFilterMode    tfMode,
aeTextureEnvironment    texEnv
 

Set all texture parameters in one call.

This allows you to set the texturefilter and texture-environment for a texture target in one call. See the documentation of the parameter types for possible param values and their description.

Parameters:
targetTex Target texture. Must be one of AE_TEXTURE_1D, AE_TEXTURE_2D, or AE_TEXTURE_3D.
tfMode Texture filtering mode. See aeTextureFilterMode for possible values.
texEnv Texture environment. See aeTextureEnvironment for possible values.
See also:
aeTextureFilterMode, aeTextureEnvironment, aeRendererUnit.

void aeOpenGLRenderer::_setViewMatrix const aeMatrix4   viewMat [virtual]
 

Replace the current view transform matrix in the view matrix stack.

Parameters:
worldMat New view transform matrix.

Implements aeRenderer.

void aeOpenGLRenderer::_setWorldMatrix const aeMatrix4   worldMat [virtual]
 

Replace the current world transform matrix in the world matrix stack.

Parameters:
worldMat New world transform matrix.

Implements aeRenderer.

void aeOpenGLRenderer::addViewport aeViewport *    vp,
bool    becomesActive = false
[virtual]
 

Add a new viewport.

If you want the new viewport to become the active viewport set becomesActive to true.

Parameters:
vp Viewport to add.
becomesActive Set to true if you want the new viewport to become the active viewport.

Implements aeRenderer.

void aeOpenGLRenderer::closeWindow   [virtual]
 

Close a rendering window.

Implements aeRenderer.

GLint aeOpenGLRenderer::convertaeDepthBufferFunc2OpenGL aeDepthBufferFunc    depthFunc const [private]
 

Converts aeDepthBufferFunc to OpenGL depth buffer function.

Parameters:
depthFunc aeDepthBufferFunc depth buffer function to convert.
Returns:
OpenGL depth buffer function equivalent to the passed in aeDepthBufferFunc.

aeDepthBufferFunc aeOpenGLRenderer::convertOpenGLDepthBufferFunc2AE GLint    depthFunc const [private]
 

Converts OpenGL depth buffer function to aeDepthBufferFunc.

Parameters:
depthFunc OpenGL depth buffer function to convert.
Returns:
aeDepthBufferFunc equivalent for the OpenGL depth buffer function.

bool aeOpenGLRenderer::createWindow   [virtual]
 

Create a rendering window.

Returns:
True if the window was created succesfully, false if not.

Implements aeRenderer.

aeViewport aeOpenGLRenderer::findViewportByName const char *    vpName const [virtual]
 

Find a viewport by name.

Parameters:
vpName Name of the viewport to search for.
Returns:
The viewport that matches the name, or NULL if it was not found.

Implements aeRenderer.

aeViewport aeOpenGLRenderer::getActiveViewport   const [virtual]
 

Get the active viewport.

Returns:
The active viewport, or NULL if there are no viewports or none of the viewports is active.

Implements aeRenderer.

aeShadeMode aeOpenGLRenderer::getShadeMode   const [virtual]
 

Get primitive shading mode.

Returns:
Current primitive shading mode.
See also:
aeRenderer::setShadingMode

Implements aeRenderer.

void aeOpenGLRenderer::initialize   [virtual]
 

Initialize the rendering system.

Returns:
True if the initialization was a success, false if not.

Implements aeRenderer.

void aeOpenGLRenderer::reinitialize   [virtual]
 

Re-initialize the rendering system.

This is used to reinit the rendering system after e.g. a configuration change.

Returns:
True if the re-initialization was a success, false if not.

Implements aeRenderer.

void aeOpenGLRenderer::removeAllViewports   [virtual]
 

Remove all viewports.

Implements aeRenderer.

void aeOpenGLRenderer::removeViewport const char *    vpName [virtual]
 

Remove a viewport given its name.

Parameters:
vpName The name of the viewport to remove.

Implements aeRenderer.

void aeOpenGLRenderer::setOptions aeRendererOptions   ropts,
bool    reinitialize = false
[virtual]
 

Set rendering options.

Parameters:
n_ropts New rendering options.
reinitialize Set this to true to automagically call aeOpenGLRenderer::reinitialize() after the call to setOptions. Otherwise (this is the default) you will have to call aeOpenGLRenderer::reinitialize() yourself to make the new options active.
See also:
aeRendererOptions, aeRenderer::getOptions.

Implements aeRenderer.

void aeOpenGLRenderer::setShadeMode aeShadeMode    sm [virtual]
 

Set primitive shading mode (flat or smooth shading).

Specifies how vertex colors should be shaded over a primitive. For possible values see aeShadingMode.

See also:
aeShadingMode.

Implements aeRenderer.

void aeOpenGLRenderer::shutdown   [virtual]
 

Shutdown the rendering system.

Implements aeRenderer.


The documentation for this class was generated from the following file:
AE Engine Public API Reference
Generated on Wed Apr 9 09:43:41 2003 by Doxygen.