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

aeDirect3D9Renderer Class Reference

Direct3D 9 rendering system. More...

#include <d3d9_renderer.h>

Inheritance diagram for aeDirect3D9Renderer:

aeRenderer aePlugin aeBase List of all members.

Public Member Functions

 aeDirect3D9Renderer (aeRegistry *reg, bool fullscreen, int winWidth, int winHeight, int winBpp)
 Create a new Direct3D 9 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.


Detailed Description

Direct3D 9 rendering system.

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

See also:
aeRenderer, aeOpenGLRenderer.

Definition at line 43 of file d3d9_renderer.h.


Constructor & Destructor Documentation

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

Create a new Direct3D 9 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 aeDirect3D9Renderer::_finishFrame   [virtual]
 

Finish rendering a frame.

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

Implements aeRenderer.

void aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_getActiveTextureUnit   const [virtual]
 

Get the currently active texture unit.

Returns:
The active texture unit.

Implements aeRenderer.

aeDepthBufferFunc aeDirect3D9Renderer::_getDepthBufferFunction   const [virtual]
 

Get the current depth buffer comparison function.

Returns:
The current depth buffer comparison function.

Implements aeRenderer.

bool aeDirect3D9Renderer::_getDepthBufferTest   const [virtual]
 

Check if depth testing is on or off.

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

Implements aeRenderer.

bool aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_getTextureEnvironment   const [virtual]
 

Get the current texture environment parameters.

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

Implements aeRenderer.

aeTextureFilterMode aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_setActiveTextureUnit int    texUnit [virtual]
 

Set the active texture unit.

Parameters:
texUnit Texture unit to activate.

Implements aeRenderer.

void aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_setDepthBufferFunction aeDepthBufferFunc    depthFunc [virtual]
 

Set depth buffer comparison function.

See aeDepthBufferFunc for possible values.

Parameters:
depthFunc Depth comparison function.

Implements aeRenderer.

void aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_setDepthBufferTest bool    depthTest [virtual]
 

Enable/disable depth testing.

Parameters:
depthTest Enable/disable depth testing.

Implements aeRenderer.

void aeDirect3D9Renderer::_setDepthBufferWrite bool    depthWrite [virtual]
 

Enable/disable writing to depth buffer.

Parameters:
flag Enable/disable depth buffer write.

Implements aeRenderer.

void aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_setTextureEnvironment aeTextureEnvironment    texEnv [virtual]
 

Set the texture environment parameters.

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

Implements aeRenderer.

void aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::_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 aeDirect3D9Renderer::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 aeDirect3D9Renderer::closeWindow   [virtual]
 

Close a rendering window.

Implements aeRenderer.

bool aeDirect3D9Renderer::createWindow   [virtual]
 

Create a rendering window.

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

Implements aeRenderer.

aeViewport aeDirect3D9Renderer::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 aeDirect3D9Renderer::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 aeDirect3D9Renderer::getShadeMode   const [virtual]
 

Get primitive shading mode.

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

Implements aeRenderer.

void aeDirect3D9Renderer::initialize   [virtual]
 

Initialize the rendering system.

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

Implements aeRenderer.

void aeDirect3D9Renderer::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 aeDirect3D9Renderer::removeAllViewports   [virtual]
 

Remove all viewports.

Implements aeRenderer.

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

Remove a viewport given its name.

Parameters:
vpName The name of the viewport to remove.

Implements aeRenderer.

void aeDirect3D9Renderer::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 aeDirect3D9Renderer::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 aeDirect3D9Renderer::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:40 2003 by Doxygen.