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

aeRenderer Class Reference

The AE 3D graphics API. More...

#include <renderer.h>

Inheritance diagram for aeRenderer:

aePlugin aeBase aeDirect3D9Renderer aeOpenGLRenderer List of all members.

Public Member Functions

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

virtual void initialize ()=0
 Initialize the rendering system.

virtual void reinitialize ()=0
 Re-initialize the rendering system.

virtual void shutdown ()=0
 Shutdown the rendering system.

virtual bool createWindow ()=0
 Create a rendering window.

virtual void closeWindow ()=0
 Close a rendering window.

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

virtual aeRendererOptions getOptions () const
 Get rendering options.

virtual int getTexUnitCount () const
 Get the number of texture units the hardware supports.

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

virtual aeShadeMode getShadeMode () const=0
 Get primitive shading mode.

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

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

virtual void removeAllViewports ()=0
 Remove all viewports.

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

virtual aeViewport getActiveViewport () const=0
 Get the active viewport.

virtual void _flushPipeline ()=0
 Flush the rendering pipeline.

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

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

virtual void _setTextureParams (aeTextureTarget targetTex, aeTextureFilterMode tfMode, aeTextureEnvironment texEnv)=0
 Set all texture parameters in one call.

virtual void _setTextureFilter (aeTextureTarget targetTex, aeTextureFilterMode tfMode)=0
 Set texture filtering mode (none, bilinear, or trilinear).

virtual aeTextureFilterMode _getTextureFilter (aeTextureTarget targetTex) const=0
 Get the texture filtering mode for specified target texture.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

virtual void _prepareFrame ()=0
 Prepare for rendering a frame.

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

virtual void _finishFrame ()=0
 Finish rendering a frame.


Private Attributes

aeRegistryaeReg
 Pointer to global registry.

aeRendererName rendererName
 Name of the renderer (ie. AE_DIRECT3D9RENDERER or AE_OPENGLRENDERER).

aeRendererOptions rendererOpts
 Renderer options.

int texUnitCount
 Number of texture units in the hardware.


Detailed Description

The AE 3D graphics API.

This class is an abstract interface to different "real" 3D graphics APIs (like OpenGL and Direct3D). Each of the 3D APIs should derive from this class and define their own implementation of the methods in this class, so that this class remains the one common interface to graphics rendering.

The engine uses this class for all of its rendering.

The advanced AE API user can use this class to achieve greater control and flexibility over the rendering process. You can have a direct, low-level access to the 3D API and its states and primitives, and you don't have to care about which "real" 3D API is actually in use.

Definition at line 49 of file renderer.h.


Constructor & Destructor Documentation

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

Create a new renderer.

This is only called from the derived rendering subsystems' constructors. It will initialize the rendererOpts with the values passed in.

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


Member Function Documentation

virtual void aeRenderer::_finishFrame   [pure virtual]
 

Finish rendering a frame.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_flushPipeline   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual int aeRenderer::_getActiveTextureUnit   const [pure virtual]
 

Get the currently active texture unit.

Returns:
The active texture unit.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeDepthBufferFunc aeRenderer::_getDepthBufferFunction   const [pure virtual]
 

Get the current depth buffer comparison function.

Returns:
The current depth buffer comparison function.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual bool aeRenderer::_getDepthBufferTest   const [pure virtual]
 

Check if depth testing is on or off.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual bool aeRenderer::_getDepthBufferWrite   const [pure virtual]
 

Check if the depth buffer is writable or not.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeTextureEnvironment aeRenderer::_getTextureEnvironment   const [pure virtual]
 

Get the current texture environment parameters.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeTextureFilterMode aeRenderer::_getTextureFilter aeTextureTarget    targetTex const [pure virtual]
 

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, aeTextureTarget.

virtual void aeRenderer::_popProjectionMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_popViewMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_popWorldMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_prepareFrame   [pure virtual]
 

Prepare for rendering a frame.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_pushProjectionMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_pushViewMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_pushWorldMatrix   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_render aeRenderOperation   renderOp [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setActiveTextureUnit int    texUnit [pure virtual]
 

Set the active texture unit.

Parameters:
texUnit Texture unit to activate.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setBlendFunction aeBlendFunc    src,
aeBlendFunc    dest
[pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setDepthBufferFunction aeDepthBufferFunc    depthFunc [pure virtual]
 

Set depth buffer comparison function.

See aeDepthBufferFunc for possible values.

Parameters:
depthFunc Depth comparison function.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setDepthBufferParams bool    depthTest,
bool    depthWrite,
aeDepthBufferFunc    depthFunc
[pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setDepthBufferTest bool    depthTest [pure virtual]
 

Enable/disable depth testing.

Parameters:
depthTest Enable/disable depth testing.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setDepthBufferWrite bool    depthWrite [pure virtual]
 

Enable/disable writing to depth buffer.

Parameters:
flag Enable/disable depth buffer write.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setProjectionMatrix const aeMatrix4   projMat [pure virtual]
 

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

Parameters:
worldMat New projection transform matrix.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setTextureEnvironment aeTextureEnvironment    texEnv [pure virtual]
 

Set the texture environment parameters.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setTextureFilter aeTextureTarget    targetTex,
aeTextureFilterMode    tfMode
[pure virtual]
 

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, aeTextureTarget.

virtual void aeRenderer::_setTextureParams aeTextureTarget    targetTex,
aeTextureFilterMode    tfMode,
aeTextureEnvironment    texEnv
[pure virtual]
 

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, aeTextureTarget.

virtual void aeRenderer::_setViewMatrix const aeMatrix4   viewMat [pure virtual]
 

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

Parameters:
worldMat New view transform matrix.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::_setWorldMatrix const aeMatrix4   worldMat [pure virtual]
 

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

Parameters:
worldMat New world transform matrix.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::addViewport aeViewport *    vp,
bool    becomesActive = false
[pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::closeWindow   [pure virtual]
 

Close a rendering window.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual bool aeRenderer::createWindow   [pure virtual]
 

Create a rendering window.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeViewport aeRenderer::findViewportByName const char *    vpName const [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeViewport aeRenderer::getActiveViewport   const [pure virtual]
 

Get the active viewport.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual aeRendererOptions aeRenderer::getOptions   const [inline, virtual]
 

Get rendering options.

You can use this to get the rendering options, then change them, and use aeRenderer::setOptions to set them.

Returns:
The rendering options.
See also:
aeRenderer::setOptions

Definition at line 134 of file renderer.h.

virtual aeShadeMode aeRenderer::getShadeMode   const [pure virtual]
 

Get primitive shading mode.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual int aeRenderer::getTexUnitCount   const [inline, virtual]
 

Get the number of texture units the hardware supports.

Returns:
The number of texture units the hardware supports.

Definition at line 141 of file renderer.h.

virtual void aeRenderer::initialize   [pure virtual]
 

Initialize the rendering system.

Each of the 3D APIs should define their own initialization routines.

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

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::reinitialize   [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::removeAllViewports   [pure virtual]
 

Remove all viewports.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::removeViewport const char *    vpName [pure virtual]
 

Remove a viewport given its name.

Parameters:
vpName The name of the viewport to remove.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::setOptions aeRendererOptions   ropts,
bool    reinitialize = false
[pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::setShadeMode aeShadeMode    sm [pure 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.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.

virtual void aeRenderer::shutdown   [pure virtual]
 

Shutdown the rendering system.

Each of the 3D APIs should define their own shutdown routines.

Implemented in aeDirect3D9Renderer, and aeOpenGLRenderer.


Member Data Documentation

aeRendererOptions aeRenderer::rendererOpts [private]
 

Renderer options.

These can be modified by the user by first getting them with aeRenderer::getOptions, then modifying as wanted, and setting back with aeRenderer::setOptions.

See also:
aeRendererOptions, aeRenderer::getOptions, aeRenderer::setOptions.

Definition at line 64 of file renderer.h.


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.