#include <OgreD3D9RenderSystem.h>
Inheritance diagram for Ogre::D3D9RenderSystem:
Public Types | |||||||||||||
typedef MapIterator< Ogre::RenderTargetMap > | RenderTargetIterator | ||||||||||||
Iterator over RenderTargets. | |||||||||||||
Public Member Functions | |||||||||||||
D3D9RenderSystem (HINSTANCE hInstance) | |||||||||||||
~D3D9RenderSystem () | |||||||||||||
virtual void | initConfigOptions (void) | ||||||||||||
ConfigOptionMap & | getConfigOptions (void) | ||||||||||||
Returns the details of this API's configuration options. | |||||||||||||
String | validateConfigOptions (void) | ||||||||||||
Validates the options set for the rendering system, returning a message if there are problems. | |||||||||||||
RenderWindow * | initialise (bool autoCreateWindow, const String &windowTitle="OGRE Render Window") | ||||||||||||
Start up the renderer using the settings selected (Or the defaults if none have been selected). | |||||||||||||
RenderWindow * | createRenderWindow (const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0) | ||||||||||||
Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific] Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None) Key: "parentWindowHandle" [API specific] Description: Parent window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong for GLX (display*:screen:windowHandle) Default: 0 (None) Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0 Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0 Key: "border" Description: The type of window border (in windowed mode) Values: none, fixed, resize Default: resize Key: "outerDimensions" Description: Whether the width/height is expressed as the size of the outer window, rather than the content area Values: true, false Default: false
Key: "useNVPerfHUD" [DX9 specific] Description: Enable the use of nVidia NVPerfHUD Values: true, false Default: false | |||||||||||||
RenderTexture * | createRenderTexture (const String &name, unsigned int width, unsigned int height, TextureType texType=TEX_TYPE_2D, PixelFormat internalFormat=PF_X8R8G8B8, const NameValuePairList *miscParams=0) | ||||||||||||
| |||||||||||||
virtual MultiRenderTarget * | createMultiRenderTarget (const String &name) | ||||||||||||
Surfaces can be bound and unbound at will. This fails if mCapabilities->numMultiRenderTargets() is smaller than 2. | |||||||||||||
String | getErrorDescription (long errorNumber) const | ||||||||||||
Returns a description of an error code. | |||||||||||||
const String & | getName (void) const | ||||||||||||
Returns the name of the rendering system. | |||||||||||||
void | setConfigOption (const String &name, const String &value) | ||||||||||||
Sets an option for this API. | |||||||||||||
void | reinitialise () | ||||||||||||
Restart the renderer (normally following a change in settings). | |||||||||||||
void | shutdown () | ||||||||||||
Shutdown the renderer and cleanup resources. | |||||||||||||
void | setAmbientLight (float r, float g, float b) | ||||||||||||
Sets the colour & strength of the ambient (global directionless) light in the world. | |||||||||||||
void | setShadingType (ShadeOptions so) | ||||||||||||
Sets the type of light shading required (default = Gouraud). | |||||||||||||
void | setLightingEnabled (bool enabled) | ||||||||||||
Sets whether or not dynamic lighting is enabled. | |||||||||||||
void | destroyRenderTarget (const String &name) | ||||||||||||
Destroys a render target of any sort. | |||||||||||||
VertexElementType | getColourVertexElementType (void) const | ||||||||||||
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem. | |||||||||||||
void | setStencilCheckEnabled (bool enabled) | ||||||||||||
Turns stencil buffer checking on or off. | |||||||||||||
void | setStencilBufferParams (CompareFunction func=CMPF_ALWAYS_PASS, uint32 refValue=0, uint32 mask=0xFFFFFFFF, StencilOperation stencilFailOp=SOP_KEEP, StencilOperation depthFailOp=SOP_KEEP, StencilOperation passOp=SOP_KEEP, bool twoSidedOperation=false) | ||||||||||||
This method allows you to set all the stencil buffer parameters in one call. | |||||||||||||
void | setNormaliseNormals (bool normalise) | ||||||||||||
Sets whether or not normals are to be automatically normalised. | |||||||||||||
void | _useLights (const LightList &lights, unsigned short limit) | ||||||||||||
Tells the rendersystem to use the attached set of lights (and no others) up to the number specified (this allows the same list to be used with different count limits). | |||||||||||||
void | _setWorldMatrix (const Matrix4 &m) | ||||||||||||
Sets the world transform matrix. | |||||||||||||
void | _setViewMatrix (const Matrix4 &m) | ||||||||||||
Sets the view transform matrix. | |||||||||||||
void | _setProjectionMatrix (const Matrix4 &m) | ||||||||||||
Sets the projection transform matrix. | |||||||||||||
void | _setSurfaceParams (const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking) | ||||||||||||
Sets the surface properties to be used for future rendering. | |||||||||||||
void | _setPointSpritesEnabled (bool enabled) | ||||||||||||
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) or plain points. | |||||||||||||
void | _setPointParameters (Real size, bool attenuationEnabled, Real constant, Real linear, Real quadratic, Real minSize, Real maxSize) | ||||||||||||
Sets the size of points and how they are attenuated with distance. | |||||||||||||
void | _setTexture (size_t unit, bool enabled, const String &texname) | ||||||||||||
Sets the status of a single texture stage. | |||||||||||||
void | _setTextureCoordSet (size_t unit, size_t index) | ||||||||||||
Sets the texture coordinate set to use for a texture unit. | |||||||||||||
void | _setTextureCoordCalculation (size_t unit, TexCoordCalcMethod m, const Frustum *frustum=0) | ||||||||||||
Sets a method for automatically calculating texture coordinates for a stage. | |||||||||||||
void | _setTextureBlendMode (size_t unit, const LayerBlendModeEx &bm) | ||||||||||||
Sets the texture blend modes from a TextureUnitState record. | |||||||||||||
void | _setTextureAddressingMode (size_t stage, const TextureUnitState::UVWAddressingMode &uvw) | ||||||||||||
Sets the texture addressing mode for a texture unit. | |||||||||||||
void | _setTextureBorderColour (size_t stage, const ColourValue &colour) | ||||||||||||
Sets the texture border colour for a texture unit. | |||||||||||||
void | _setTextureMatrix (size_t unit, const Matrix4 &xform) | ||||||||||||
Sets the texture coordinate transformation matrix for a texture unit. | |||||||||||||
void | _setSceneBlending (SceneBlendFactor sourceFactor, SceneBlendFactor destFactor) | ||||||||||||
Sets the global blending factors for combining subsequent renders with the existing frame contents. | |||||||||||||
void | _setAlphaRejectSettings (CompareFunction func, unsigned char value) | ||||||||||||
Sets the global alpha rejection approach for future renders. | |||||||||||||
void | _setViewport (Viewport *vp) | ||||||||||||
Sets the provided viewport as the active one for future rendering operations. | |||||||||||||
void | _beginFrame (void) | ||||||||||||
Signifies the beginning of a frame, ie the start of rendering on a single viewport. | |||||||||||||
void | _endFrame (void) | ||||||||||||
Ends rendering of a frame to the current viewport. | |||||||||||||
void | _setCullingMode (CullingMode mode) | ||||||||||||
Sets the culling mode for the render system based on the 'vertex winding'. | |||||||||||||
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. | |||||||||||||
void | _setDepthBufferCheckEnabled (bool enabled=true) | ||||||||||||
Sets whether or not the depth buffer check is performed before a pixel write. | |||||||||||||
void | _setColourBufferWriteEnabled (bool red, bool green, bool blue, bool alpha) | ||||||||||||
Sets whether or not colour buffer writing is enabled, and for which channels. | |||||||||||||
void | _setDepthBufferWriteEnabled (bool enabled=true) | ||||||||||||
Sets whether or not the depth buffer is updated after a pixel write. | |||||||||||||
void | _setDepthBufferFunction (CompareFunction func=CMPF_LESS_EQUAL) | ||||||||||||
Sets the comparison function for the depth buffer check. | |||||||||||||
void | _setDepthBias (ushort bias) | ||||||||||||
Sets the depth bias, NB you should use the Material version of this. | |||||||||||||
void | _setFog (FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=1.0, Real linearStart=0.0, Real linearEnd=1.0) | ||||||||||||
Sets the fogging mode for future geometry. | |||||||||||||
void | _convertProjectionMatrix (const Matrix4 &matrix, Matrix4 &dest, bool forGpuProgram=false) | ||||||||||||
Converts a uniform projection matrix to suitable for this render system. | |||||||||||||
void | _makeProjectionMatrix (const Radian &fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest, bool forGpuProgram=false) | ||||||||||||
Builds a perspective projection matrix suitable for this render system. | |||||||||||||
void | _makeProjectionMatrix (Real left, Real right, Real bottom, Real top, Real nearPlane, Real farPlane, Matrix4 &dest, bool forGpuProgram=false) | ||||||||||||
Builds a perspective projection matrix for the case when frustum is not centered around camera. | |||||||||||||
void | _makeOrthoMatrix (const Radian &fovy, Real aspect, Real nearPlane, Real farPlane, Matrix4 &dest, bool forGpuProgram=false) | ||||||||||||
Builds an orthographic projection matrix suitable for this render system. | |||||||||||||
void | _applyObliqueDepthProjection (Matrix4 &matrix, const Plane &plane, bool forGpuProgram) | ||||||||||||
Update a perspective projection matrix to use 'oblique depth projection'. | |||||||||||||
void | _setPolygonMode (PolygonMode level) | ||||||||||||
Sets how to rasterise triangles, as points, wireframe or solid polys. | |||||||||||||
void | _setTextureUnitFiltering (size_t unit, FilterType ftype, FilterOptions filter) | ||||||||||||
Sets a single filter for a given texture unit. | |||||||||||||
void | _setTextureLayerAnisotropy (size_t unit, unsigned int maxAnisotropy) | ||||||||||||
Sets the maximal anisotropy for the specified texture unit. | |||||||||||||
void | setVertexDeclaration (VertexDeclaration *decl) | ||||||||||||
Sets the current vertex declaration, ie the source of vertex data. | |||||||||||||
void | setVertexBufferBinding (VertexBufferBinding *binding) | ||||||||||||
Sets the current vertex buffer binding state. | |||||||||||||
void | _render (const RenderOperation &op) | ||||||||||||
Render something to the active viewport. | |||||||||||||
void | bindGpuProgram (GpuProgram *prg) | ||||||||||||
See RenderSystem. | |||||||||||||
void | unbindGpuProgram (GpuProgramType gptype) | ||||||||||||
See RenderSystem. | |||||||||||||
void | bindGpuProgramParameters (GpuProgramType gptype, GpuProgramParametersSharedPtr params) | ||||||||||||
See RenderSystem. | |||||||||||||
void | bindGpuProgramPassIterationParameters (GpuProgramType gptype) | ||||||||||||
See RenderSystem. | |||||||||||||
void | setClipPlanes (const PlaneList &clipPlanes) | ||||||||||||
See RenderSystem. | |||||||||||||
void | setScissorTest (bool enabled, size_t left=0, size_t top=0, size_t right=800, size_t bottom=600) | ||||||||||||
Sets the 'scissor region' ie the region of the target in which rendering can take place. | |||||||||||||
void | clearFrameBuffer (unsigned int buffers, const ColourValue &colour=ColourValue::Black, Real depth=1.0f, unsigned short stencil=0) | ||||||||||||
Clears one or more frame buffers on the active render target. | |||||||||||||
void | setClipPlane (ushort index, Real A, Real B, Real C, Real D) | ||||||||||||
Set a clipping plane. | |||||||||||||
void | enableClipPlane (ushort index, bool enable) | ||||||||||||
Enable the clipping plane. | |||||||||||||
HardwareOcclusionQuery * | createHardwareOcclusionQuery (void) | ||||||||||||
Create an object for performing hardware occlusion queries. | |||||||||||||
Real | getHorizontalTexelOffset (void) | ||||||||||||
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this rendersystem. | |||||||||||||
Real | getVerticalTexelOffset (void) | ||||||||||||
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this rendersystem. | |||||||||||||
Real | getMinimumDepthInputValue (void) | ||||||||||||
Gets the minimum (closest) depth value to be used when rendering using identity transforms. | |||||||||||||
Real | getMaximumDepthInputValue (void) | ||||||||||||
Gets the maximum (farthest) depth value to be used when rendering using identity transforms. | |||||||||||||
void | restoreLostDevice (void) | ||||||||||||
D3D specific method to restore a lost device. | |||||||||||||
bool | isDeviceLost (void) | ||||||||||||
D3D specific method to return whether the device has been lost. | |||||||||||||
void | _notifyDeviceLost (void) | ||||||||||||
Notify that a device has been lost. | |||||||||||||
D3DFORMAT | _getDepthStencilFormatFor (D3DFORMAT fmt) | ||||||||||||
Check which depthStencil formats can be used with a certain pixel format, and return the best suited. | |||||||||||||
IDirect3DSurface9 * | _getDepthStencilFor (D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, size_t width, size_t height) | ||||||||||||
Get a depth stencil surface that is compatible with an internal pixel format and multisample type. | |||||||||||||
void | _cleanupDepthStencils () | ||||||||||||
Clear all cached depth stencil surfaces. | |||||||||||||
virtual void | destroyHardwareOcclusionQuery (HardwareOcclusionQuery *hq) | ||||||||||||
Destroy a hardware occlusion query object. | |||||||||||||
void | setWBufferEnabled (bool enabled) | ||||||||||||
Sets whether or not W-buffers are enabled if they are avalible for this renderer. | |||||||||||||
bool | getWBufferEnabled (void) const | ||||||||||||
Returns true if the renderer will try to use W-buffers when avalible. | |||||||||||||
virtual void | destroyRenderWindow (const String &name) | ||||||||||||
Destroys a render window. | |||||||||||||
virtual void | destroyRenderTexture (const String &name) | ||||||||||||
Destroys a render texture. | |||||||||||||
virtual void | attachRenderTarget (RenderTarget &target) | ||||||||||||
Attaches the passed render target to the render system. | |||||||||||||
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. | |||||||||||||
virtual RenderTarget * | detachRenderTarget (const String &name) | ||||||||||||
Detaches the render target with the passed name from the render system and returns a pointer to it. | |||||||||||||
virtual RenderTargetIterator | getRenderTargetIterator (void) | ||||||||||||
Returns a specialised MapIterator over all render targets attached to the RenderSystem. | |||||||||||||
void | setWaitForVerticalBlank (bool enabled) | ||||||||||||
Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers. | |||||||||||||
bool | getWaitForVerticalBlank (void) const | ||||||||||||
Returns true if the system is synchronising frames with the monitor vertical blank. | |||||||||||||
virtual void | _setWorldMatrices (const Matrix4 *m, unsigned short count) | ||||||||||||
Sets multiple world matrices (vertex blending). | |||||||||||||
virtual void | _setTextureUnitSettings (size_t texUnit, TextureUnitState &tl) | ||||||||||||
Utility function for setting all the properties of a texture unit at once. | |||||||||||||
virtual void | _disableTextureUnit (size_t texUnit) | ||||||||||||
Turns off a texture unit. | |||||||||||||
virtual void | _disableTextureUnitsFrom (size_t texUnit) | ||||||||||||
Disables all texture units from the given unit upwards. | |||||||||||||
virtual void | _setTextureUnitFiltering (size_t unit, FilterOptions minFilter, FilterOptions magFilter, FilterOptions mipFilter) | ||||||||||||
Sets the filtering options for a given texture unit. | |||||||||||||
virtual Viewport * | _getViewport (void) | ||||||||||||
Get the current active viewport for rendering. | |||||||||||||
virtual CullingMode | _getCullingMode (void) const | ||||||||||||
virtual void | _beginGeometryCount (void) | ||||||||||||
The RenderSystem will keep a count of tris rendered, this resets the count. | |||||||||||||
virtual unsigned int | _getFaceCount (void) const | ||||||||||||
Reports the number of tris rendered since the last _beginGeometryCount call. | |||||||||||||
virtual unsigned int | _getVertexCount (void) const | ||||||||||||
Reports the number of vertices passed to the renderer since the last _beginGeometryCount call. | |||||||||||||
virtual void | convertColourValue (const ColourValue &colour, uint32 *pDest) | ||||||||||||
Generates a packed data version of the passed in ColourValue suitable for use as with this RenderSystem. | |||||||||||||
const RenderSystemCapabilities * | getCapabilities (void) const | ||||||||||||
Gets the capabilities of the render system. | |||||||||||||
virtual bool | isGpuProgramBound (GpuProgramType gptype) | ||||||||||||
Returns whether or not a Gpu program of the given type is currently bound. | |||||||||||||
virtual void | _initRenderTargets (void) | ||||||||||||
Utility method for initialising all render targets attached to this rendering system. | |||||||||||||
virtual void | _notifyCameraRemoved (const Camera *cam) | ||||||||||||
Utility method to notify all render targets that a camera has been removed, incase they were referring to it as their viewer. | |||||||||||||
virtual void | _updateAllRenderTargets (void) | ||||||||||||
Internal method for updating all render targets attached to this rendering system. | |||||||||||||
virtual void | setClipPlane (ushort index, const Plane &p) | ||||||||||||
Set a clipping plane. | |||||||||||||
virtual void | setInvertVertexWinding (bool invert) | ||||||||||||
Sets whether or not vertex windings set should be inverted; this can be important for rendering reflections. | |||||||||||||
void | setCurrentPassIterationCount (const size_t count) | ||||||||||||
set the current multi pass count value. | |||||||||||||
virtual void | addListener (Listener *l) | ||||||||||||
Adds a listener to the custom events that this render system can raise. | |||||||||||||
virtual void | removeListener (Listener *l) | ||||||||||||
Remove a listener to the custom events that this render system can raise. | |||||||||||||
virtual const StringVector & | getRenderSystemEvents (void) const | ||||||||||||
Gets a list of the rendersystem specific events that this rendersystem can raise. | |||||||||||||
Protected Types | |||||||||||||
typedef std::list< Listener * > | ListenerList | ||||||||||||
typedef std::list< HardwareOcclusionQuery * > | HardwareOcclusionQueryList | ||||||||||||
Protected Member Functions | |||||||||||||
bool | updatePassIterationRenderState (void) | ||||||||||||
updates pass iteration rendering state including bound gpu program parameter pass iteration auto constant entry | |||||||||||||
virtual void | fireEvent (const String &name, const NameValuePairList *params=0) | ||||||||||||
Internal method for firing a rendersystem event. | |||||||||||||
Protected Attributes | |||||||||||||
RenderTargetMap | mRenderTargets | ||||||||||||
The render targets. | |||||||||||||
RenderTargetPriorityMap | mPrioritisedRenderTargets | ||||||||||||
The render targets, ordered by priority. | |||||||||||||
RenderTarget * | mActiveRenderTarget | ||||||||||||
The Active render target. | |||||||||||||
GpuProgramParametersSharedPtr | mActiveVertexGpuProgramParameters | ||||||||||||
The Active GPU programs and gpu program parameters. | |||||||||||||
GpuProgramParametersSharedPtr | mActiveFragmentGpuProgramParameters | ||||||||||||
TextureManager * | mTextureManager | ||||||||||||
RenderSystemCapabilities * | mCapabilities | ||||||||||||
Used to store the capabilities of the graphics card. | |||||||||||||
Viewport * | mActiveViewport | ||||||||||||
CullingMode | mCullingMode | ||||||||||||
bool | mVSync | ||||||||||||
bool | mWBuffer | ||||||||||||
size_t | mFaceCount | ||||||||||||
size_t | mVertexCount | ||||||||||||
Matrix4 | mWorldMatrices [256] | ||||||||||||
Saved set of world matrices. | |||||||||||||
ColourValue | mManualBlendColours [OGRE_MAX_TEXTURE_LAYERS][2] | ||||||||||||
Saved manual colour blends. | |||||||||||||
bool | mInvertVertexWinding | ||||||||||||
size_t | mCurrentPassIterationCount | ||||||||||||
number of times to render the current state | |||||||||||||
StringVector | mEventNames | ||||||||||||
List of names of events this rendersystem may raise. | |||||||||||||
ListenerList | mEventListeners | ||||||||||||
HardwareOcclusionQueryList | mHwOcclusionQueries | ||||||||||||
bool | mVertexProgramBound | ||||||||||||
bool | mFragmentProgramBound | ||||||||||||
Private Types | |||||||||||||
typedef std::vector< D3D9RenderWindow * > | SecondaryWindowList | ||||||||||||
typedef HashMap< unsigned int, D3DFORMAT > | DepthStencilHash | ||||||||||||
Mapping of texture format -> DepthStencil. | |||||||||||||
typedef std::pair< D3DFORMAT, D3DMULTISAMPLE_TYPE > | ZBufferFormat | ||||||||||||
Mapping of depthstencil format -> depthstencil buffer Keep one depthstencil buffer around for every format that is used, it must be large enough to hold the largest rendering target. | |||||||||||||
typedef std::map< ZBufferFormat, ZBufferRef > | ZBufferHash | ||||||||||||
Private Member Functions | |||||||||||||
D3D9DriverList * | getDirect3DDrivers (void) | ||||||||||||
void | refreshD3DSettings (void) | ||||||||||||
void | freeDevice (void) | ||||||||||||
bool | compareDecls (D3DVERTEXELEMENT9 *pDecl1, D3DVERTEXELEMENT9 *pDecl2, size_t size) | ||||||||||||
void | initInputDevices (void) | ||||||||||||
void | processInputDevices (void) | ||||||||||||
void | setD3D9Light (size_t index, Light *light) | ||||||||||||
HRESULT | __SetRenderState (D3DRENDERSTATETYPE state, DWORD value) | ||||||||||||
HRESULT | __SetSamplerState (DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value) | ||||||||||||
HRESULT | __SetTextureStageState (DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value) | ||||||||||||
HRESULT | __SetFloatRenderState (D3DRENDERSTATETYPE state, Real value) | ||||||||||||
DWORD | _getCurrentAnisotropy (size_t unit) | ||||||||||||
return anisotropy level | |||||||||||||
bool | _checkMultiSampleQuality (D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen) | ||||||||||||
check if a FSAA is supported | |||||||||||||
void | _setFSAA (D3DMULTISAMPLE_TYPE type, DWORD qualityLevel) | ||||||||||||
set FSAA | |||||||||||||
void | initCapabilities (void) | ||||||||||||
Internal method for populating the capabilities structure. | |||||||||||||
void | convertVertexShaderCaps (void) | ||||||||||||
void | convertPixelShaderCaps (void) | ||||||||||||
Private Attributes | |||||||||||||
LPDIRECT3D9 | mpD3D | ||||||||||||
Direct3D. | |||||||||||||
LPDIRECT3DDEVICE9 | mpD3DDevice | ||||||||||||
Direct3D rendering device. | |||||||||||||
ConfigOptionMap | mOptions | ||||||||||||
D3DMULTISAMPLE_TYPE | mFSAAType | ||||||||||||
full-screen multisampling antialiasing type | |||||||||||||
DWORD | mFSAAQuality | ||||||||||||
full-screen multisampling antialiasing level | |||||||||||||
HINSTANCE | mhInstance | ||||||||||||
instance | |||||||||||||
D3D9DriverList * | mDriverList | ||||||||||||
List of D3D drivers installed (video cards). | |||||||||||||
D3D9Driver * | mActiveD3DDriver | ||||||||||||
Currently active driver. | |||||||||||||
D3DCAPS9 | mCaps | ||||||||||||
Device caps. | |||||||||||||
bool | mUseNVPerfHUD | ||||||||||||
NVPerfHUD allowed? | |||||||||||||
Ogre::D3D9RenderSystem::sD3DTextureStageDesc | mTexStageDesc [OGRE_MAX_TEXTURE_LAYERS] | ||||||||||||
structure holding texture unit settings for every stage | |||||||||||||
Light * | mLights [MAX_LIGHTS] | ||||||||||||
D3D9HardwareBufferManager * | mHardwareBufferManager | ||||||||||||
D3D9GpuProgramManager * | mGpuProgramManager | ||||||||||||
size_t | mLastVertexSourceCount | ||||||||||||
unsigned short | mCurrentLights | ||||||||||||
Matrix4 | mViewMatrix | ||||||||||||
Saved last view matrix. | |||||||||||||
D3D9RenderWindow * | mPrimaryWindow | ||||||||||||
Primary window, the one used to create the device. | |||||||||||||
SecondaryWindowList | mSecondaryWindows | ||||||||||||
bool | mDeviceLost | ||||||||||||
bool | mBasicStatesInitialised | ||||||||||||
DepthStencilHash | mDepthStencilHash | ||||||||||||
ZBufferHash | mZBufferHash |
Definition at line 50 of file OgreD3D9RenderSystem.h.
|
Mapping of texture format -> DepthStencil. Used as cache by _getDepthStencilFormatFor Definition at line 161 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1111 of file OgreRenderSystem.h. |
|
Definition at line 1108 of file OgreRenderSystem.h. |
|
Iterator over RenderTargets.
Definition at line 399 of file OgreRenderSystem.h. Referenced by Ogre::RenderSystem::getRenderTargetIterator(). |
|
Definition at line 152 of file OgreD3D9RenderSystem.h. |
|
Mapping of depthstencil format -> depthstencil buffer Keep one depthstencil buffer around for every format that is used, it must be large enough to hold the largest rendering target. This is used as cache by _getDepthStencilFor. Definition at line 169 of file OgreD3D9RenderSystem.h. |
|
Definition at line 175 of file OgreD3D9RenderSystem.h. |
|
|
|
|
|
Definition at line 112 of file OgreD3D9RenderSystem.h. References __SetRenderState(), and Ogre::Real. |
|
Referenced by __SetFloatRenderState(). |
|
|
|
|
|
Update a perspective projection matrix to use 'oblique depth projection'.
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.
|
|
check if a FSAA is supported
|
|
Clear all cached depth stencil surfaces.
|
|
Converts a uniform projection matrix to suitable for this render system.
Implements Ogre::RenderSystem. |
|
Turns off a texture unit.
|
|
Disables all texture units from the given unit upwards.
|
|
Ends rendering of a frame to the current viewport.
Implements Ogre::RenderSystem. |
|
|
|
return anisotropy level
|
|
Get a depth stencil surface that is compatible with an internal pixel format and multisample type.
|
|
Check which depthStencil formats can be used with a certain pixel format, and return the best suited.
|
|
Reports the number of tris rendered since the last _beginGeometryCount call.
|
|
Reports the number of vertices passed to the renderer since the last _beginGeometryCount call.
|
|
Get the current active viewport for rendering.
|
|
Utility method for initialising all render targets attached to this rendering system.
|
|
Builds an orthographic projection matrix suitable for this render system.
Implements Ogre::RenderSystem. |
|
Builds a perspective projection matrix for the case when frustum is not centered around camera.
Implements Ogre::RenderSystem. |
|
Builds a perspective projection matrix suitable for this render system.
Implements Ogre::RenderSystem. |
|
Utility method to notify all render targets that a camera has been removed, incase they were referring to it as their viewer.
|
|
Notify that a device has been lost.
|
|
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 whether or not colour buffer writing is enabled, and for which channels.
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. |
|
Sets the depth bias, NB you should use the Material version of this.
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. |
|
set FSAA
|
|
Sets the size of points and how they are attenuated with distance.
Implements Ogre::RenderSystem. |
|
Sets whether or not rendering points using OT_POINT_LIST will render point sprites (textured quads) or plain points.
Implements Ogre::RenderSystem. |
|
Sets how to rasterise triangles, as points, wireframe or solid polys.
Implements Ogre::RenderSystem. |
|
Sets the projection transform matrix.
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 TextureUnitState record. Meant for use internally only - apps should use the Material and TextureUnitState classes.
Implements Ogre::RenderSystem. |
|
Sets the texture border colour for a texture unit.
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 TextureUnitState classes let you manage textures far more easily.
Implements Ogre::RenderSystem. |
|
Sets the maximal anisotropy for the specified texture unit.
Implements Ogre::RenderSystem. |
|
Sets the texture coordinate transformation matrix for a texture unit.
Implements Ogre::RenderSystem. |
|
Sets the filtering options for a given texture unit.
|
|
Sets a single filter for a given 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. |
|
Internal method for updating all render targets attached to this rendering system.
|
|
Tells the rendersystem to use the attached set of lights (and no others) up to the number specified (this allows the same list to be used with different count limits).
Implements Ogre::RenderSystem. |
|
Adds a listener to the custom events that this render system can raise.
|
|
Attaches the passed render target to the render system.
|
|
See RenderSystem.
Reimplemented from Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
Clears one or more frame buffers on the active render target.
Implements Ogre::RenderSystem. |
|
|
|
Generates a packed data version of the passed in ColourValue suitable for use as with this RenderSystem.
|
|
|
|
|
|
Create an object for performing hardware occlusion queries.
Implements Ogre::RenderSystem. |
|
Surfaces can be bound and unbound at will. This fails if mCapabilities->numMultiRenderTargets() is smaller than 2.
Implements Ogre::RenderSystem. |
|
Reimplemented from Ogre::RenderSystem. |
|
Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific] Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None) Key: "parentWindowHandle" [API specific] Description: Parent window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong for GLX (display*:screen:windowHandle) Default: 0 (None) Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0 Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0 Key: "border" Description: The type of window border (in windowed mode) Values: none, fixed, resize Default: resize Key: "outerDimensions" Description: Whether the width/height is expressed as the size of the outer window, rather than the content area Values: true, false Default: false Key: "useNVPerfHUD" [DX9 specific] Description: Enable the use of nVidia NVPerfHUD Values: true, false Default: false
Implements Ogre::RenderSystem. |
|
Destroy a hardware occlusion query object.
|
|
Destroys a render target of any sort.
Reimplemented from Ogre::RenderSystem. |
|
Destroys a render texture.
|
|
Destroys a render window.
|
|
Detaches the render target with the passed name from the render system and returns a pointer to it.
|
|
Enable the clipping plane.
Implements Ogre::RenderSystem. |
|
Internal method for firing a rendersystem event.
|
|
|
|
Gets the capabilities of the render system.
Definition at line 893 of file OgreRenderSystem.h. |
|
Get the native VertexElementType for a compact 32-bit colour value for this rendersystem.
Implements Ogre::RenderSystem. |
|
Returns the details of this API's configuration options.
Implements Ogre::RenderSystem. |
|
|
|
Returns a description of an error code.
Implements Ogre::RenderSystem. |
|
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this rendersystem.
Implements Ogre::RenderSystem. |
|
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
Implements Ogre::RenderSystem. |
|
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
Implements Ogre::RenderSystem. |
|
Returns the name of the rendering system.
Implements Ogre::RenderSystem. |
|
Gets a list of the rendersystem specific events that this rendersystem can raise.
Definition at line 1051 of file OgreRenderSystem.h. References Ogre::StringVector. |
|
Returns a pointer to the render target with the passed name, or NULL if that render target cannot be found.
|
|
Returns a specialised MapIterator over all render targets attached to the RenderSystem.
Definition at line 402 of file OgreRenderSystem.h. References Ogre::RenderSystem::RenderTargetIterator. |
|
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this rendersystem.
Implements Ogre::RenderSystem. |
|
Returns true if the system is synchronising frames with the monitor vertical blank.
|
|
Returns true if the renderer will try to use W-buffers when avalible.
|
|
Internal method for populating the capabilities structure.
|
|
|
|
Start up the renderer using the settings selected (Or the defaults if none have been selected).
Reimplemented from Ogre::RenderSystem. |
|
|
|
D3D specific method to return whether the device has been lost.
|
|
Returns whether or not a Gpu program of the given type is currently bound.
|
|
|
|
|
|
Restart the renderer (normally following a change in settings).
Implements Ogre::RenderSystem. |
|
Remove a listener to the custom events that this render system can raise.
|
|
D3D specific method to restore a lost device.
|
|
Sets the colour & strength of the ambient (global directionless) light in the world.
Implements Ogre::RenderSystem. |
|
Set a clipping plane.
|
|
Set a clipping plane.
Implements Ogre::RenderSystem. |
|
See RenderSystem.
Implements Ogre::RenderSystem. |
|
Sets an option for this API.
Implements Ogre::RenderSystem. |
|
set the current multi pass count value. This must be set prior to calling _render() if multiple renderings of the same pass state are required.
Definition at line 1009 of file OgreRenderSystem.h. |
|
|
|
Sets whether or not vertex windings set should be inverted; this can be important for rendering reflections.
|
|
Sets whether or not dynamic lighting is enabled.
Implements Ogre::RenderSystem. |
|
Sets whether or not normals are to be automatically normalised.
Implements Ogre::RenderSystem. |
|
Sets the 'scissor region' ie the region of the target in which rendering can take place.
Implements Ogre::RenderSystem. |
|
Sets the type of light shading required (default = Gouraud).
Implements Ogre::RenderSystem. |
|
This method allows you to set all the stencil buffer parameters in one call.
Implements Ogre::RenderSystem. |
|
Turns stencil buffer checking on or off.
Implements Ogre::RenderSystem. |
|
Sets the current vertex buffer binding state.
Implements Ogre::RenderSystem. |
|
Sets the current vertex declaration, ie the source of vertex data.
Implements Ogre::RenderSystem. |
|
Defines whether or now fullscreen render windows wait for the vertical blank before flipping buffers.
|
|
Sets whether or not W-buffers are enabled if they are avalible for this renderer.
|
|
Shutdown the renderer and cleanup resources.
Reimplemented from Ogre::RenderSystem. |
|
See RenderSystem.
Reimplemented from Ogre::RenderSystem. |
|
updates pass iteration rendering state including bound gpu program parameter pass iteration auto constant entry
|
|
Validates the options set for the rendering system, returning a message if there are problems.
Implements Ogre::RenderSystem. |
|
Currently active driver.
Definition at line 71 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1063 of file OgreRenderSystem.h. |
|
The Active render target.
Definition at line 1060 of file OgreRenderSystem.h. |
|
The Active GPU programs and gpu program parameters.
Definition at line 1062 of file OgreRenderSystem.h. |
|
Definition at line 1075 of file OgreRenderSystem.h. |
|
Definition at line 157 of file OgreD3D9RenderSystem.h. |
|
Used to store the capabilities of the graphics card.
Definition at line 1072 of file OgreRenderSystem.h. |
|
Device caps.
Definition at line 73 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1077 of file OgreRenderSystem.h. |
|
Definition at line 142 of file OgreD3D9RenderSystem.h. |
|
number of times to render the current state
Definition at line 1094 of file OgreRenderSystem.h. |
|
Definition at line 162 of file OgreD3D9RenderSystem.h. |
|
Definition at line 156 of file OgreD3D9RenderSystem.h. |
|
List of D3D drivers installed (video cards).
Definition at line 69 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1109 of file OgreRenderSystem.h. |
|
List of names of events this rendersystem may raise.
Definition at line 1103 of file OgreRenderSystem.h. |
|
Definition at line 1082 of file OgreRenderSystem.h. |
|
Definition at line 1115 of file OgreRenderSystem.h. |
|
full-screen multisampling antialiasing level
Definition at line 63 of file OgreD3D9RenderSystem.h. |
|
full-screen multisampling antialiasing type
Definition at line 61 of file OgreD3D9RenderSystem.h. |
|
Definition at line 130 of file OgreD3D9RenderSystem.h. |
|
Definition at line 129 of file OgreD3D9RenderSystem.h. |
|
instance
Definition at line 66 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1112 of file OgreRenderSystem.h. |
|
Definition at line 1091 of file OgreRenderSystem.h. |
|
Definition at line 133 of file OgreD3D9RenderSystem.h. |
|
Definition at line 94 of file OgreD3D9RenderSystem.h. |
|
Saved manual colour blends.
Definition at line 1089 of file OgreRenderSystem.h. |
|
Definition at line 59 of file OgreD3D9RenderSystem.h. |
|
Direct3D.
Definition at line 54 of file OgreD3D9RenderSystem.h. |
|
Direct3D rendering device.
Definition at line 56 of file OgreD3D9RenderSystem.h. |
|
Primary window, the one used to create the device.
Definition at line 150 of file OgreD3D9RenderSystem.h. |
|
The render targets, ordered by priority.
Definition at line 1058 of file OgreRenderSystem.h. |
|
The render targets.
Definition at line 1056 of file OgreRenderSystem.h. |
|
Definition at line 154 of file OgreD3D9RenderSystem.h. |
|
structure holding texture unit settings for every stage
|
|
Definition at line 1069 of file OgreRenderSystem.h. |
|
NVPerfHUD allowed?
Definition at line 75 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1083 of file OgreRenderSystem.h. |
|
Definition at line 1114 of file OgreRenderSystem.h. |
|
Saved last view matrix.
Definition at line 144 of file OgreD3D9RenderSystem.h. |
|
Definition at line 1079 of file OgreRenderSystem.h. |
|
Definition at line 1080 of file OgreRenderSystem.h. |
|
Saved set of world matrices.
Definition at line 1086 of file OgreRenderSystem.h. |
|
Definition at line 176 of file OgreD3D9RenderSystem.h. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:51:04 2006