Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::D3DRenderSystem Class Reference

Implementation of DirectX as a rendering system. More...

#include <OgreD3D7RenderSystem.h>

Inheritance diagram for Ogre::D3DRenderSystem:

Ogre::RenderSystem List of all members.

Public Methods

 D3DRenderSystem (HINSTANCE hInstance)
 ~D3DRenderSystem ()
const StringgetName (void) const
 See RenderSystem. More...

ConfigOptionMapgetConfigOptions (void)
 See RenderSystem. More...

void setConfigOption (const String &name, const String &value)
 See RenderSystem. More...

String validateConfigOptions (void)
 See RenderSystem. More...

RenderWindowinitialise (bool autoCreateWindow)
 See RenderSystem. More...

void reinitialise (void)
 See RenderSystem. More...

void shutdown (void)
 See RenderSystem. More...

void startRendering (void)
 See RenderSystem. More...

void setAmbientLight (float r, float g, float b)
 See RenderSystem. More...

void setShadingType (ShadeOptions so)
 See RenderSystem. More...

void setTextureFiltering (TextureFilterOptions fo)
 See RenderSystem. More...

void setLightingEnabled (bool enabled)
 See RenderSystem. More...

RenderWindowcreateRenderWindow (const String &name, int width, int height, int colourDepth, bool fullScreen, int left=0, int top=0, bool depthBuffer=true, RenderWindow *parentWindowHandle=0)
 See RenderSystem. More...

RenderTexturecreateRenderTexture (const String &name, int width, int height)
 Creates and registers a render texture object. More...

void destroyRenderWindow (RenderWindow *pWin)
 See RenderSystem. More...

String getErrorDescription (long errorNumber)
 See RenderSystem. More...

void convertColourValue (const ColourValue &colour, unsigned long *pDest)
 See RenderSystem. More...

void _addLight (Light *lt)
 See RenderSystem. More...

void _removeLight (Light *lt)
 See RenderSystem. More...

void _modifyLight (Light *lt)
 See RenderSystem. More...

void _removeAllLights (void)
 See RenderSystem. More...

void _pushRenderState (void)
 See RenderSystem. More...

void _popRenderState (void)
 See RenderSystem. More...

void _setWorldMatrix (const Matrix4 &m)
 See RenderSystem. More...

void _setViewMatrix (const Matrix4 &m)
 See RenderSystem. More...

void _setProjectionMatrix (const Matrix4 &m)
 See RenderSystem. More...

void _setSurfaceParams (const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess)
 See RenderSystem. More...

unsigned short _getNumTextureUnits (void)
 See RenderSystem. More...

void _setTexture (int unit, bool enabled, const String &texname)
 See RenderSystem. More...

void _setTextureCoordSet (int stage, int index)
 See RenderSystem. More...

void _setTextureCoordCalculation (int stage, TexCoordCalcMethod m)
 See RenderSystem. More...

void _setTextureBlendMode (int stage, const LayerBlendModeEx &bm)
 See RenderSystem. More...

void _setTextureAddressingMode (int stage, Material::TextureLayer::TextureAddressingMode tam)
 See RenderSystem. More...

void _setTextureMatrix (int stage, const Matrix4 &xform)
 See RenderSystem. More...

void _setSceneBlending (SceneBlendFactor sourceFactor, SceneBlendFactor destFactor)
 See RenderSystem. More...

void _setAlphaRejectSettings (CompareFunction func, unsigned char value)
 See RenderSystem. More...

void _setViewport (Viewport *vp)
 See RenderSystem. More...

void _beginFrame (void)
 See RenderSystem. More...

void _render (RenderOperation &op)
 See RenderSystem. More...

void _endFrame (void)
 See RenderSystem. More...

void _setCullingMode (CullingMode mode)
 See RenderSystem. More...

void _setDepthBufferParams (bool depthTest=true, bool depthWrite=true, CompareFunction depthFunction=CMPF_LESS_EQUAL)
 See RenderSystem. More...

void _setDepthBufferCheckEnabled (bool enabled=true)
 See RenderSystem. More...

void _setDepthBufferWriteEnabled (bool enabled=true)
 See RenderSystem. More...

void _setDepthBufferFunction (CompareFunction func=CMPF_LESS_EQUAL)
 See RenderSystem. More...

void _setDepthBias (ushort bias)
 See RenderSystem. More...

void _setFog (FogMode mode, ColourValue colour, Real density, Real start, Real end)
 See RenderSystem. More...

void _makeProjectionMatrix (Real fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest)
 See RenderSystem. More...

void _setRasterisationMode (SceneDetailLevel level)
 See RenderSystem. More...

void setStencilCheckEnabled (bool enabled)
 See RenderSystem. More...

bool hasHardwareStencil (void)
 See RenderSystem. More...

ushort getStencilBufferBitDepth (void)
 See RenderSystem. More...

void setStencilBufferFunction (CompareFunction func)
 See RenderSystem. More...

void setStencilBufferReferenceValue (ulong refValue)
 See RenderSystem. More...

void setStencilBufferMask (ulong mask)
 See RenderSystem. More...

void setStencilBufferFailOperation (StencilOperation op)
 See RenderSystem. More...

void setStencilBufferDepthFailOperation (StencilOperation op)
 See RenderSystem. More...

void setStencilBufferPassOperation (StencilOperation op)
 See RenderSystem. More...

virtual void addFrameListener (FrameListener *newListener)
 Registers a FrameListener which will be called back every frame. More...

virtual void removeFrameListener (FrameListener *oldListener)
 Removes a FrameListener from the list of listening classes. More...

virtual void attachRenderTarget (RenderTarget &target)
 Don't do this anymore, just allow via Root RenderSystem* regPtr = Root::getSingleton().getRenderSystem(); if (!regPtr || regPtr != this) Register self - library user has come to me direct Root::getSingleton().setRenderSystem(this);. More...

virtual RenderTargetgetRenderTarget (const String &name)
 Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found. More...

virtual RenderTargetdetachRenderTarget (const String &name)
 Detaches the render target with the passed name from the render system and returns a pointer to it. More...

void setWaitForVerticalBlank (bool enabled)
 Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers. More...

bool getWaitForVerticalBlank (void)
 Returns true if the system is synchronising frames with the monitor vertical blank. More...

virtual void _setWorldMatrices (const Matrix4 *m, unsigned short count)
 Sets multiple world matrices (vertex blending). More...

virtual void _setTextureUnitSettings (int texUnit, Material::TextureLayer &tl)
 Utility function for setting all the properties of a texture unit at once. More...

virtual void _disableTextureUnit (int texUnit)
 Turns off a texture unit. More...

virtual Viewport_getViewport (void)
 Get the current active viewport for rendering. More...

virtual CullingMode _getCullingMode (void)
virtual void _beginGeometryCount (void)
 The RenderSystem will keep a count of tris rendered, this resets the count. More...

virtual unsigned int _getFaceCount (void)
 Reports the number of tris rendered since the last _beginGeometryCount call. More...

virtual unsigned int _getVertexCount (void)
 Reports the number of vertices passed to the renderer since the last _beginGeometryCount call. More...

virtual bool _isVertexBlendSupported (void)
 Returns whether or not this RenderSystem supports hardware vertex blending, ie multiple world matrices per vertex with blending weights. More...

virtual unsigned short _getNumVertexBlendMatrices (void)
 Returns the number of matrices available to hardware vertex blending for this rendering system. More...

virtual void setStencilBufferParams (CompareFunction func=CMPF_ALWAYS_PASS, ulong refValue=0, ulong mask=0xFFFFFFFF, StencilOperation stencilFailOp=SOP_KEEP, StencilOperation depthFailOp=SOP_KEEP, StencilOperation passOp=SOP_KEEP)
 This method allows you to set all the stencil buffer parameters in one call. More...

void softwareVertexBlend (RenderOperation &op, Matrix4 *pMatrices)
 Performs a software vertex blend on the passed in operation. More...


Protected Methods

bool fireFrameStarted (FrameEvent &evt)
 Internal method for raising frame started events. More...

bool fireFrameEnded (FrameEvent &evt)
 Internal method for raising frame ended events. More...


Protected Attributes

std::set< FrameListener * > mFrameListeners
 Set of registered frame listeners. More...

ConfigOptionMap mOptions
RenderTargetMap mRenderTargets
 The render targets. More...

RenderTargetPriorityMap mPrioritisedRenderTargets
 The render targets, ordered by priority. More...

RenderTargetmActiveRenderTarget
 The Active render target. More...

TextureManagermTextureManager
ViewportmActiveViewport
CullingMode mCullingMode
bool mVSync
Material::TextureLayer mTextureUnits [OGRE_MAX_TEXTURE_LAYERS]
unsigned int mFaceCount
unsigned int mVertexCount
Matrix4 mWorldMatrices [256]
 Saved set of world matrices. More...

std::vector< RealmTempVertexBlendBuffer
 Temporary buffer for vertex blending in software. More...

std::vector< RealmTempNormalBlendBuffer

Private Methods

DDDriverListgetDirectDrawDrivers (void)
void refreshDDSettings (void)
D3DMATRIX makeD3DMatrix (const Matrix4 &mat)
Matrix4 convertD3DMatrix (const D3DMATRIX &mat)
void initConfigOptions (void)
void initInputDevices (void)
void processInputDevices (void)
void setD3DLight (int index, Light *light)
D3DCMPFUNC convertCompareFunction (CompareFunction func)
D3DSTENCILOP convertStencilOp (StencilOperation op)

Private Attributes

LPDIRECT3DDEVICE7 mlpD3DDevice
D3DDEVICEDESC7 mD3DDeviceDesc
DDDriverListmDriverList
DDDrivermActiveDDDriver
LightmLights [MAX_LIGHTS]
HINSTANCE mhInstance

Detailed Description

Implementation of DirectX as a rendering system.


Constructor & Destructor Documentation

Ogre::D3DRenderSystem::D3DRenderSystem HINSTANCE    hInstance
 

Ogre::D3DRenderSystem::~D3DRenderSystem  
 


Member Function Documentation

void Ogre::D3DRenderSystem::_addLight Light   lt [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_beginFrame void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::_beginGeometryCount void    [virtual, inherited]
 

The RenderSystem will keep a count of tris rendered, this resets the count.

void Ogre::RenderSystem::_disableTextureUnit int    texUnit [virtual, inherited]
 

Turns off a texture unit.

void Ogre::D3DRenderSystem::_endFrame void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

CullingMode Ogre::RenderSystem::_getCullingMode void    [virtual, inherited]
 

unsigned int Ogre::RenderSystem::_getFaceCount void    [virtual, inherited]
 

Reports the number of tris rendered since the last _beginGeometryCount call.

unsigned short Ogre::D3DRenderSystem::_getNumTextureUnits void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

unsigned short Ogre::RenderSystem::_getNumVertexBlendMatrices void    [virtual, inherited]
 

Returns the number of matrices available to hardware vertex blending for this rendering system.

unsigned int Ogre::RenderSystem::_getVertexCount void    [virtual, inherited]
 

Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.

Viewport * Ogre::RenderSystem::_getViewport void    [virtual, inherited]
 

Get the current active viewport for rendering.

bool Ogre::RenderSystem::_isVertexBlendSupported void    [virtual, inherited]
 

Returns whether or not this RenderSystem supports hardware vertex blending, ie multiple world matrices per vertex with blending weights.

void Ogre::D3DRenderSystem::_makeProjectionMatrix Real    fovy,
Real    aspect,
Real    nearPlane,
Real    farPlane,
Matrix4   dest
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_modifyLight Light   lt [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_popRenderState void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_pushRenderState void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_removeAllLights void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_removeLight Light   lt [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_render RenderOperation   op [virtual]
 

See RenderSystem.

Reimplemented from Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setAlphaRejectSettings CompareFunction    func,
unsigned char    value
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setCullingMode CullingMode    mode [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setDepthBias ushort    bias [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setDepthBufferCheckEnabled bool    enabled = true [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setDepthBufferFunction CompareFunction    func = CMPF_LESS_EQUAL [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setDepthBufferParams bool    depthTest = true,
bool    depthWrite = true,
CompareFunction    depthFunction = CMPF_LESS_EQUAL
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setDepthBufferWriteEnabled bool    enabled = true [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setFog FogMode    mode,
ColourValue    colour,
Real    density,
Real    start,
Real    end
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setProjectionMatrix const Matrix4   m [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setRasterisationMode SceneDetailLevel    level [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setSceneBlending SceneBlendFactor    sourceFactor,
SceneBlendFactor    destFactor
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setSurfaceParams const ColourValue   ambient,
const ColourValue   diffuse,
const ColourValue   specular,
const ColourValue   emissive,
Real    shininess
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTexture int    unit,
bool    enabled,
const String   texname
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTextureAddressingMode int    stage,
Material::TextureLayer::TextureAddressingMode    tam
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTextureBlendMode int    stage,
const LayerBlendModeEx   bm
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTextureCoordCalculation int    stage,
TexCoordCalcMethod    m
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTextureCoordSet int    stage,
int    index
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setTextureMatrix int    stage,
const Matrix4   xform
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::_setTextureUnitSettings int    texUnit,
Material::TextureLayer   tl
[virtual, inherited]
 

Utility function for setting all the properties of a texture unit at once.

This method is also worth using over the individual texture unit settings because it only sets those settings which are different from the current settings for this unit, thus minimising render state changes.

void Ogre::D3DRenderSystem::_setViewMatrix const Matrix4   m [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::_setViewport Viewport   vp [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::_setWorldMatrices const Matrix4   m,
unsigned short    count
[virtual, inherited]
 

Sets multiple world matrices (vertex blending).

void Ogre::D3DRenderSystem::_setWorldMatrix const Matrix4   m [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::addFrameListener FrameListener   newListener [virtual, inherited]
 

Registers a FrameListener which will be called back every frame.

Remarks:
A FrameListener is a class which implements methods which will be called during Ogre's automatic rendering loop (started with RenderSystem::startRendering).

See the FrameListener class for more details on the specifics. It is imperitive that the instance passed to this method is not destroyed before iether the rendering loop ends, or the class is removed from the listening list using removeFrameListener.

See also:
FrameListener

void Ogre::RenderSystem::attachRenderTarget RenderTarget   target [virtual, inherited]
 

Don't do this anymore, just allow via Root RenderSystem* regPtr = Root::getSingleton().getRenderSystem(); if (!regPtr || regPtr != this) Register self - library user has come to me direct Root::getSingleton().setRenderSystem(this);.

void Ogre::D3DRenderSystem::convertColourValue const ColourValue   colour,
unsigned long *    pDest
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

D3DCMPFUNC Ogre::D3DRenderSystem::convertCompareFunction CompareFunction    func [private]
 

Matrix4 Ogre::D3DRenderSystem::convertD3DMatrix const D3DMATRIX &    mat [private]
 

D3DSTENCILOP Ogre::D3DRenderSystem::convertStencilOp StencilOperation    op [private]
 

RenderTexture * Ogre::D3DRenderSystem::createRenderTexture const String   name,
int    width,
int    height
[virtual]
 

Creates and registers a render texture object.

Parameters:
name  The name for the new render texture. Note that names must be unique.
width  The requested width for the render texture. See Remarks for more info.
height  The requested width for the render texture. See Remarks for more info.
Returns:
On succes, a pointer to a new platform-dependernt, RenderTexture-derived class is returned. On failiure, NULL is returned.
Remarks:
Because a render texture is basically a wrapper around a texture object, the width and height parameters of this method just hint the preferred size for the texture. Depending on the hardware driver or the underlying API, these values might change when the texture is created.

Implements Ogre::RenderSystem.

RenderWindow * Ogre::D3DRenderSystem::createRenderWindow const String   name,
int    width,
int    height,
int    colourDepth,
bool    fullScreen,
int    left = 0,
int    top = 0,
bool    depthBuffer = true,
RenderWindow   parentWindowHandle = 0
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::destroyRenderWindow RenderWindow   pWin
 

See RenderSystem.

RenderTarget * Ogre::RenderSystem::detachRenderTarget const String   name [virtual, inherited]
 

Detaches the render target with the passed name from the render system and returns a pointer to it.

Note:
If the render target cannot be found, NULL is returned.

bool Ogre::RenderSystem::fireFrameEnded FrameEvent   evt [protected, inherited]
 

Internal method for raising frame ended events.

bool Ogre::RenderSystem::fireFrameStarted FrameEvent   evt [protected, inherited]
 

Internal method for raising frame started events.

ConfigOptionMap & Ogre::D3DRenderSystem::getConfigOptions void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

DDDriverList * Ogre::D3DRenderSystem::getDirectDrawDrivers void    [private]
 

String Ogre::D3DRenderSystem::getErrorDescription long    errorNumber [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

const String & Ogre::D3DRenderSystem::getName void    const [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

RenderTarget * Ogre::RenderSystem::getRenderTarget const String   name [virtual, inherited]
 

Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.

ushort Ogre::D3DRenderSystem::getStencilBufferBitDepth void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

bool Ogre::RenderSystem::getWaitForVerticalBlank void    [inherited]
 

Returns true if the system is synchronising frames with the monitor vertical blank.

bool Ogre::D3DRenderSystem::hasHardwareStencil void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::initConfigOptions void    [private]
 

RenderWindow * Ogre::D3DRenderSystem::initialise bool    autoCreateWindow [virtual]
 

See RenderSystem.

Reimplemented from Ogre::RenderSystem.

void Ogre::D3DRenderSystem::initInputDevices void    [private]
 

D3DMATRIX Ogre::D3DRenderSystem::makeD3DMatrix const Matrix4   mat [private]
 

void Ogre::D3DRenderSystem::processInputDevices void    [private]
 

void Ogre::D3DRenderSystem::refreshDDSettings void    [private]
 

void Ogre::D3DRenderSystem::reinitialise void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::removeFrameListener FrameListener   oldListener [virtual, inherited]
 

Removes a FrameListener from the list of listening classes.

void Ogre::D3DRenderSystem::setAmbientLight float    r,
float    g,
float    b
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setConfigOption const String   name,
const String   value
[virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setD3DLight int    index,
Light   light
[private]
 

void Ogre::D3DRenderSystem::setLightingEnabled bool    enabled [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setShadingType ShadeOptions    so [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferDepthFailOperation StencilOperation    op [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferFailOperation StencilOperation    op [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferFunction CompareFunction    func [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferMask ulong    mask [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::setStencilBufferParams CompareFunction    func = CMPF_ALWAYS_PASS,
ulong    refValue = 0,
ulong    mask = 0xFFFFFFFF,
StencilOperation    stencilFailOp = SOP_KEEP,
StencilOperation    depthFailOp = SOP_KEEP,
StencilOperation    passOp = SOP_KEEP
[virtual, inherited]
 

This method allows you to set all the stencil buffer parameters in one call.

Remarks:
The stencil buffer is used to mask out pixels in the render target, allowing you to do effects like mirrors, cut-outs, stencil shadows and more. Each of your batches of rendering is likely to ignore the stencil buffer, update it with new values, or apply it to mask the output of the render. The stencil test is:
            (Reference Value & Mask) CompareFunction (Stencil Buffer Value & Mask)
The result of this will cause one of 3 actions depending on whether the test fails, succeeds but with the depth buffer check still failing, or succeeds with the depth buffer check passing too.

Unlike other render states, stencilling is left for the application to turn on and off when it requires. This is because you are likely to want to change parameters between batches of arbitrary objects and control the ordering yourself. In order to batch things this way, you'll want to use OGRE's separate render queue groups (see RenderQueue) and register a RenderQueueListener to get notifications between batches.

There are individual state change methods for each of the parameters set using this method. Note that the default values in this method represent the defaults at system start up too.

Parameters:
func  The comparison function applied.
refValue  The reference value used in the comparison
mask  The bitmask applied to both the stencil value and the reference value before comparison
stencilFailOp  The action to perform when the stencil check fails
depthFailOp  The action to perform when the stencil check passes, but the depth buffer check still fails
passOp  The action to take when both the stencil and depth check pass.

Reimplemented in Ogre::SDLRenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferPassOperation StencilOperation    op [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilBufferReferenceValue ulong    refValue [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setStencilCheckEnabled bool    enabled [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::D3DRenderSystem::setTextureFiltering TextureFilterOptions    fo [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.

void Ogre::RenderSystem::setWaitForVerticalBlank bool    enabled [inherited]
 

Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.

Remarks:
By default, all rendering windows wait for a vertical blank (when the CRT beam turns off briefly to move from the bottom right of the screen back to the top left) before flipping the screen buffers. This ensures that the image you see on the screen is steady. However it restricts the frame rate to the refresh rate of the monitor, and can slow the frame rate down. You can speed this up by not waiting for the blank, but this has the downside of introducing 'tearing' artefacts where part of the previous frame is still displayed as the buffers are switched. Speed vs quality, you choose.
Note:
Has NO effect on windowed mode render targets. Only affects fullscreen mode.
Parameters:
enabled  If true, the system waits for vertical blanks - quality over speed. If false it doesn't - speed over quality.

void Ogre::D3DRenderSystem::shutdown void    [virtual]
 

See RenderSystem.

Reimplemented from Ogre::RenderSystem.

void Ogre::RenderSystem::softwareVertexBlend RenderOperation   op,
Matrix4   pMatrices
[inherited]
 

Performs a software vertex blend on the passed in operation.

Remarks:
This function is supplied to calculate a vertex blend when no hardware support is available, or when the results are required by another software component. The vertices contained in the passed in operation will be modified by the matrices supplied according to the blending weights also in the operation. To avoid accidentally modifying core vertex data, a temporary vertex buffer is used for the result, which is then used in the RenderOperation instead of the original passed in vertex data.

void Ogre::D3DRenderSystem::startRendering void    [virtual]
 

See RenderSystem.

Reimplemented from Ogre::RenderSystem.

String Ogre::D3DRenderSystem::validateConfigOptions void    [virtual]
 

See RenderSystem.

Implements Ogre::RenderSystem.


Member Data Documentation

DDDriver* Ogre::D3DRenderSystem::mActiveDDDriver [private]
 

RenderTarget* Ogre::RenderSystem::mActiveRenderTarget [protected, inherited]
 

The Active render target.

Viewport* Ogre::RenderSystem::mActiveViewport [protected, inherited]
 

CullingMode Ogre::RenderSystem::mCullingMode [protected, inherited]
 

D3DDEVICEDESC7 Ogre::D3DRenderSystem::mD3DDeviceDesc [private]
 

DDDriverList* Ogre::D3DRenderSystem::mDriverList [private]
 

unsigned int Ogre::RenderSystem::mFaceCount [protected, inherited]
 

std::set<FrameListener*> Ogre::RenderSystem::mFrameListeners [protected, inherited]
 

Set of registered frame listeners.

HINSTANCE Ogre::D3DRenderSystem::mhInstance [private]
 

Light* Ogre::D3DRenderSystem::mLights[MAX_LIGHTS] [private]
 

LPDIRECT3DDEVICE7 Ogre::D3DRenderSystem::mlpD3DDevice [private]
 

ConfigOptionMap Ogre::RenderSystem::mOptions [protected, inherited]
 

RenderTargetPriorityMap Ogre::RenderSystem::mPrioritisedRenderTargets [protected, inherited]
 

The render targets, ordered by priority.

RenderTargetMap Ogre::RenderSystem::mRenderTargets [protected, inherited]
 

The render targets.

std::vector<Real> Ogre::RenderSystem::mTempNormalBlendBuffer [protected, inherited]
 

std::vector<Real> Ogre::RenderSystem::mTempVertexBlendBuffer [protected, inherited]
 

Temporary buffer for vertex blending in software.

TextureManager* Ogre::RenderSystem::mTextureManager [protected, inherited]
 

Material::TextureLayer Ogre::RenderSystem::mTextureUnits[OGRE_MAX_TEXTURE_LAYERS] [protected, inherited]
 

unsigned int Ogre::RenderSystem::mVertexCount [protected, inherited]
 

bool Ogre::RenderSystem::mVSync [protected, inherited]
 

Matrix4 Ogre::RenderSystem::mWorldMatrices[256] [protected, inherited]
 

Saved set of world matrices.

Copyright © 2002 by The OGRE Team