#include <OgreD3D8RenderSystem.h>
Inheritance diagram for Ogre::D3D8RenderSystem:
Public Methods | |
D3D8RenderSystem (HINSTANCE hInstance) | |
~D3D8RenderSystem () | |
const String & | getName (void) const |
Returns the name of the rendering system. More... | |
ConfigOptionMap & | getConfigOptions (void) |
Returns the details of this API's configuration options. More... | |
void | setConfigOption (const String &name, const String &value) |
Sets an option for this API. More... | |
String | validateConfigOptions (void) |
Validates the options set for the rendering system, returning a message if there are problems. More... | |
RenderWindow * | initialise (bool autoCreateWindow) |
Start up the renderer using the settings selected (Or the defaults if none have been selected). More... | |
void | reinitialise () |
Restart the renderer (normally following a change in settings). More... | |
void | shutdown () |
Shutdown the renderer and cleanup resources. More... | |
void | startRendering () |
Starts / restarts the automatic rendering cycle. More... | |
void | setAmbientLight (float r, float g, float b) |
Sets the colour & strength of the ambient (global directionless) light in the world. More... | |
void | setShadingType (ShadeOptions so) |
Sets the type of light shading required (default = Gouraud). More... | |
void | setTextureFiltering (TextureFilterOptions fo) |
Sets the type of texture filtering used when rendering. More... | |
void | setLightingEnabled (bool enabled) |
Sets whether or not dynamic lighting is enabled. More... | |
RenderWindow * | createRenderWindow (const String &name, int width, int height, int colourDepth, bool fullScreen, int left=0, int top=0, bool depthBuffer=true, RenderWindow *parentWindowHandle=0) |
Creates a new rendering window. More... | |
RenderTexture * | createRenderTexture (const String &name, int width, int height) |
Creates and registers a render texture object. More... | |
void | destroyRenderWindow (RenderWindow *pWin) |
String | getErrorDescription (long errorNumber) |
Returns a description of an error code. More... | |
void | convertColourValue (const ColourValue &colour, unsigned long *pDest) |
Generates a packed data version of the passed in ColourValue suitable for use as with this RenderSystem. More... | |
void | _addLight (Light *lt) |
Adds a light to the renderers list of active lights. More... | |
void | _removeLight (Light *lt) |
Removes a light from the renderers list. More... | |
void | _modifyLight (Light *lt) |
Modifies a light in the renderer. More... | |
void | _removeAllLights (void) |
Clears all the lights from the renderer. More... | |
void | _pushRenderState (void) |
Saves the current rendering state. More... | |
void | _popRenderState (void) |
Restores the render state to a previous state. More... | |
void | _setWorldMatrix (const Matrix4 &m) |
Sets the world transform matrix. More... | |
void | _setViewMatrix (const Matrix4 &m) |
Sets the view transform matrix. More... | |
void | _setProjectionMatrix (const Matrix4 &m) |
Sets the projection transform matrix. More... | |
void | _setSurfaceParams (const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess) |
Sets the surface properties to be used for future rendering. More... | |
unsigned short | _getNumTextureUnits (void) |
Returns the number of texture units the current output hardware supports. More... | |
void | _setTexture (int unit, bool enabled, const String &texname) |
Sets the status of a single texture stage. More... | |
void | _setTextureCoordSet (int stage, int index) |
Sets the texture coordinate set to use for a texture unit. More... | |
void | _setTextureCoordCalculation (int stage, TexCoordCalcMethod m) |
Sets a method for automatically calculating texture coordinates for a stage. More... | |
void | _setTextureBlendMode (int stage, const LayerBlendModeEx &bm) |
Sets the texture blend modes from a TextureLayer record. More... | |
void | _setTextureAddressingMode (int stage, Material::TextureLayer::TextureAddressingMode tam) |
Sets the texture addressing mode for a texture unit. More... | |
void | _setTextureMatrix (int stage, const Matrix4 &xform) |
Sets the texture coordinate transformation matrix for a texture unit. More... | |
void | _setSceneBlending (SceneBlendFactor sourceFactor, SceneBlendFactor destFactor) |
Sets the global blending factors for combining subsequent renders with the existing frame contents. More... | |
void | _setAlphaRejectSettings (CompareFunction func, unsigned char value) |
Sets the global alpha rejection approach for future renders. More... | |
void | _setViewport (Viewport *vp) |
Sets the provided viewport as the active one for future rendering operations. More... | |
void | _beginFrame (void) |
Signifies the beginning of a frame, ie the start of rendering on a single viewport. More... | |
void | _render (RenderOperation &op) |
Render something to the active viewport. More... | |
void | _endFrame (void) |
Ends rendering of a frame to the current viewport. More... | |
void | _setCullingMode (CullingMode mode) |
Sets the culling mode for the render system based on the 'vertex winding'. More... | |
void | _setDepthBufferParams (bool depthTest=true, bool depthWrite=true, CompareFunction depthFunction=CMPF_LESS_EQUAL) |
Sets the mode of operation for depth buffer tests from this point onwards. More... | |
void | _setDepthBufferCheckEnabled (bool enabled=true) |
Sets whether or not the depth buffer check is performed before a pixel write. More... | |
void | _setDepthBufferWriteEnabled (bool enabled=true) |
Sets whether or not the depth buffer is updated after a pixel write. More... | |
void | _setDepthBufferFunction (CompareFunction func=CMPF_LESS_EQUAL) |
Sets the comparison function for the depth buffer check. More... | |
void | _setDepthBias (ushort bias) |
See RenderSystem. More... | |
void | _setFog (FogMode mode=FOG_NONE, ColourValue colour=ColourValue::White, Real expDensity=1.0, Real linearStart=0.0, Real linearEnd=1.0) |
Sets the fogging mode for future geometry. More... | |
void | _makeProjectionMatrix (Real fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest) |
Builds a perspective projection matrix suitable for this render system. More... | |
void | _setRasterisationMode (SceneDetailLevel level) |
Sets how to rasterise triangles, as points, wireframe or solid polys. 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 RenderTarget * | getRenderTarget (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 RenderTarget * | detachRenderTarget (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... | |
RenderTarget * | mActiveRenderTarget |
The Active render target. More... | |
TextureManager * | mTextureManager |
Viewport * | mActiveViewport |
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< Real > | mTempVertexBlendBuffer |
Temporary buffer for vertex blending in software. More... | |
std::vector< Real > | mTempNormalBlendBuffer |
Private Methods | |
D3D8DriverList * | getDirect3DDrivers (void) |
void | refreshD3DSettings (void) |
bool | compareDecls (DWORD *pDecl1, DWORD *pDecl2, int size) |
D3DXMATRIX | makeD3DXMatrix (const Matrix4 &mat) |
Matrix4 | convertD3DXMatrix (const D3DXMATRIX &mat) |
void | initConfigOptions (void) |
void | initInputDevices (void) |
void | processInputDevices (void) |
void | setD3D8Light (int index, Light *light) |
D3DCMPFUNC | convertCompareFunction (CompareFunction func) |
D3DSTENCILOP | convertStencilOp (StencilOperation op) |
Private Attributes | |
LPDIRECT3D8 | mpD3D |
LPDIRECT3DDEVICE8 | mpD3DDevice |
D3D8DriverList * | mDriverList |
D3D8Driver * | mActiveD3DDriver |
D3DCAPS8 | mCaps |
BYTE * | mpRenderBuffer |
DWORD | mRenderBufferSize |
HardwareVertexBuffer | mpXYZBuffer |
HardwareVertexBuffer | mpNormalBuffer |
HardwareVertexBuffer | mpDiffuseBuffer |
HardwareVertexBuffer | mpSpecularBuffer |
HardwareVertexBuffer | mpTextures [OGRE_MAX_TEXTURE_LAYERS][4] |
UINT | mStreamsInUse |
HardwareIndexBuffer | mpIndicies |
DWORD | mCurrentDecl [D3D_MAX_DECLSIZE] |
DWORD | mhCurrentShader |
Light * | mLights [MAX_LIGHTS] |
HINSTANCE | mhInstance |
|
|
|
|
|
Adds a light to the renderers list of active lights. This method should not be called directly by user processes - this is adding a light at the rendering level. User processes should add lights using the SceneNode attachLight method Implements Ogre::RenderSystem. |
|
Signifies the beginning of a frame, ie the start of rendering on a single viewport. Will occur several times per complete frame if multiple viewports exist. Implements Ogre::RenderSystem. |
|
The RenderSystem will keep a count of tris rendered, this resets the count.
|
|
Turns off a texture unit.
|
|
Ends rendering of a frame to the current viewport.
Implements Ogre::RenderSystem. |
|
|
|
Reports the number of tris rendered since the last _beginGeometryCount call.
|
|
Returns the number of texture units the current output hardware supports. For use in rendering, this determines how many texture units the are available for multitexturing (i.e. rendering multiple textures in a single pass). Where a Material has multiple texture layers, it will try to use multitexturing where available, and where it is not available, will perform multipass rendering to achieve the same effect. Implements Ogre::RenderSystem. |
|
Returns the number of matrices available to hardware vertex blending for this rendering system.
|
|
Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.
|
|
Get the current active viewport for rendering.
|
|
Returns whether or not this RenderSystem supports hardware vertex blending, ie multiple world matrices per vertex with blending weights.
|
|
Builds a perspective projection matrix suitable for this render system.
Implements Ogre::RenderSystem. |
|
Modifies a light in the renderer. Modifies a light which has already been added using _addLight. Implements Ogre::RenderSystem. |
|
Restores the render state to a previous state.
Implements Ogre::RenderSystem. |
|
Saves the current rendering state. Stores the current rendering state on the render state stack. The state may then be altered and restored back to it's previous state using RenderSystem::_popRenderState. Used internally by Ogre to manage changes like model/view matrices, active materials/textures without having to repecify them every time. Implements Ogre::RenderSystem. |
|
Clears all the lights from the renderer. As with RenderSystem::_addLight this method is for use internally, not by user processes. See SceneManager for user-level light maintenance. Implements Ogre::RenderSystem. |
|
Removes a light from the renderers list. As with RenderSystem::_addLight this method is for use internally, not by user processes. See SceneNode for user-level light maintenance. Implements Ogre::RenderSystem. |
|
Render something to the active viewport. Low-level rendering interface to perform rendering operations. Unlikely to be used directly by client applications, since the SceneManager and various support classes will be responsible for calling this method. Can only be called between _beginScene and _endScene
Reimplemented from Ogre::RenderSystem. |
|
Sets the global alpha rejection approach for future renders. By default images are rendered regardless of texture alpha. This method lets you change that.
Implements Ogre::RenderSystem. |
|
Sets the culling mode for the render system based on the 'vertex winding'. A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of triangles. Vertex winding refers to the direction in which the vertices are passed or indexed to in the rendering operation as viewed from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing. You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex winding is uncertain. Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
Sets whether or not the depth buffer check is performed before a pixel write.
Implements Ogre::RenderSystem. |
|
Sets the comparison function for the depth buffer check. Advanced use only - allows you to choose the function applied to compare the depth values of new and existing pixels in the depth buffer. Only an issue if the deoth buffer check is enabled (see _setDepthBufferCheckEnabled)
Implements Ogre::RenderSystem. |
|
Sets the mode of operation for depth buffer tests from this point onwards. Sometimes you may wish to alter the behaviour of the depth buffer to achieve special effects. Because it's unlikely that you'll set these options for an entire frame, but rather use them to tweak settings between rendering objects, this is an internal method (indicated by the '_' prefix) which will be used by a SceneManager implementation rather than directly from the client application. If this method is never called the settings are automatically the same as the default parameters.
Implements Ogre::RenderSystem. |
|
Sets whether or not the depth buffer is updated after a pixel write.
Implements Ogre::RenderSystem. |
|
Sets the fogging mode for future geometry.
Implements Ogre::RenderSystem. |
|
Sets the projection transform matrix.
Implements Ogre::RenderSystem. |
|
Sets how to rasterise triangles, as points, wireframe or solid polys.
Implements Ogre::RenderSystem. |
|
Sets the global blending factors for combining subsequent renders with the existing frame contents. The result of the blending operation is: final = (texture * sourceFactor) + (pixel * destFactor) Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor enumerated type.
Implements Ogre::RenderSystem. |
|
Sets the surface properties to be used for future rendering. This method sets the the properties of the surfaces of objects to be rendered after it. In this context these surface properties are the amount of each type of light the object reflects (determining it's colour under different types of light), whether it emits light itself, and how shiny it is. Textures are not dealt with here, see the _setTetxure method for details. This method is used by _setMaterial so does not need to be called direct if that method is being used.
Implements Ogre::RenderSystem. |
|
Sets the status of a single texture stage. Sets the details of a texture stage, to be used for all primitives rendered afterwards. User processes would not normally call this direct unless rendering primitives themselves - the SubEntity class is designed to manage materials for objects. Note that this method is called by _setMaterial.
Implements Ogre::RenderSystem. |
|
Sets the texture addressing mode for a texture unit.
Implements Ogre::RenderSystem. |
|
Sets the texture blend modes from a TextureLayer record. Meant for use internally only - apps should use the Material and TextureLayer classes.
Implements Ogre::RenderSystem. |
|
Sets a method for automatically calculating texture coordinates for a stage. Should not be used by apps - for use by Ogre only.
Implements Ogre::RenderSystem. |
|
Sets the texture coordinate set to use for a texture unit. Meant for use internally - not generally used directly by apps - the Material and TextureLayer classes let you manage textures far more easily.
Implements Ogre::RenderSystem. |
|
Sets the texture coordinate transformation matrix for a texture unit.
Implements Ogre::RenderSystem. |
|
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. |
|
Sets the view transform matrix.
Implements Ogre::RenderSystem. |
|
Sets the provided viewport as the active one for future rendering operations. This viewport is aware of it's own camera and render target. Must be implemented by subclass.
Implements Ogre::RenderSystem. |
|
Sets multiple world matrices (vertex blending).
|
|
Sets the world transform matrix.
Implements Ogre::RenderSystem. |
|
Registers a FrameListener which will be called back every frame.
|
|
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);.
|
|
|
|
Generates a packed data version of the passed in ColourValue suitable for use as with this RenderSystem.
Implements Ogre::RenderSystem. |
|
|
|
|
|
|
|
Creates and registers a render texture object.
Implements Ogre::RenderSystem. |
|
Creates a new rendering window.
Implements Ogre::RenderSystem. |
|
|
|
Detaches the render target with the passed name from the render system and returns a pointer to it.
|
|
Internal method for raising frame ended events.
|
|
Internal method for raising frame started events.
|
|
Returns the details of this API's configuration options.
Implements Ogre::RenderSystem. |
|
|
|
Returns a description of an error code.
Implements Ogre::RenderSystem. |
|
Returns the name of the rendering system.
Implements Ogre::RenderSystem. |
|
Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.
|
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
Returns true if the system is synchronising frames with the monitor vertical blank.
|
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
|
|
Start up the renderer using the settings selected (Or the defaults if none have been selected).
Reimplemented from Ogre::RenderSystem. |
|
|
|
|
|
|
|
|
|
Restart the renderer (normally following a change in settings).
Implements Ogre::RenderSystem. |
|
Removes a FrameListener from the list of listening classes.
|
|
Sets the colour & strength of the ambient (global directionless) light in the world.
Implements Ogre::RenderSystem. |
|
Sets an option for this API.
Implements Ogre::RenderSystem. |
|
|
|
Sets whether or not dynamic lighting is enabled.
Implements Ogre::RenderSystem. |
|
Sets the type of light shading required (default = Gouraud).
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
This method allows you to set all the stencil buffer parameters in one call.
Reimplemented in Ogre::SDLRenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
Sets the type of texture filtering used when rendering.
Implements Ogre::RenderSystem. |
|
Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.
|
|
Shutdown the renderer and cleanup resources.
Reimplemented from Ogre::RenderSystem. |
|
Performs a software vertex blend on the passed in operation.
|
|
Starts / restarts the automatic rendering cycle.
Reimplemented from Ogre::RenderSystem. |
|
Validates the options set for the rendering system, returning a message if there are problems.
Implements Ogre::RenderSystem. |
|
|
|
The Active render target.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set of registered frame listeners.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The render targets, ordered by priority.
|
|
|
|
|
|
|
|
|
|
The render targets.
|
|
|
|
|
|
Temporary buffer for vertex blending in software.
|
|
|
|
|
|
|
|
|
|
Saved set of world matrices.
|
Copyright © 2002 by The OGRE Team