GFXD3D9Device Class Reference#include <gfxD3D9Device.h>
Inheritance diagram for GFXD3D9Device:
[legend]List of all members.
|
Debug Vertex Buffer information/management |
| void | addVertexBuffer (GFXD3D9VertexBuffer *buffer) |
| void | removeVertexBuffer (GFXD3D9VertexBuffer *buffer) |
| void | logVertexBuffers () |
| U32 | mNumAllocatedVertexBuffers |
| | To keep track of how many are allocated and freed.
|
| GFXD3D9VertexBuffer * | mVBListHead |
Public Member Functions |
| GFXTextureObject * | createRenderSurface (U32 width, U32 height, GFXFormat format, U32 mipLevel) |
| | GFXD3D9Device (LPDIRECT3D9 d3d, U32 index) |
| | Constructor.
|
| virtual | ~GFXD3D9Device () |
| virtual void | init (const GFXVideoMode &mode, PlatformWindow *window=NULL)=0 |
| | Initialize this GFXDevice, optionally specifying a platform window to bind to.
|
| virtual void | preDestroy () |
| | This is called before this, or any other device, is deleted in the global destroy() method.
|
| GFXAdapterType | getAdapterType () |
| | Returns active graphics adapter type.
|
| virtual GFXCubemap * | createCubemap () |
| virtual F32 | getPixelShaderVersion () const |
| virtual void | setPixelShaderVersion (F32 version) |
| virtual void | disableShaders () |
| virtual void | setShader (GFXShader *shader) |
| virtual U32 | getNumSamplers () const |
| | Returns the number of texture samplers that can be used in a shader rendering pass.
|
| virtual void | clear (U32 flags, ColorI color, F32 z, U32 stencil) |
| virtual bool | beginSceneInternal () |
| virtual void | endSceneInternal () |
| virtual void | setViewport (const RectI &rect) |
| virtual const RectI & | getViewport () const |
| virtual void | setClipRect (const RectI &rect) |
| virtual const RectI & | getClipRect () const |
| void | setVB (GFXVertexBuffer *buffer) |
| virtual GFXVertexBuffer * | allocVertexBuffer (U32 numVerts, U32 vertFlags, U32 vertSize, GFXBufferType bufferType) |
| | This allocates a vertex buffer and returns a pointer to the allocated buffer.
|
| virtual GFXPrimitiveBuffer * | allocPrimitiveBuffer (U32 numIndices, U32 numPrimitives, GFXBufferType bufferType) |
| | This allocates a primitive buffer and returns a pointer to the allocated buffer.
|
| virtual void | deallocVertexBuffer (GFXD3D9VertexBuffer *vertBuff) |
| virtual U32 | getMaxDynamicVerts () |
| virtual U32 | getMaxDynamicIndices () |
| virtual void | drawPrimitive (GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount) |
| virtual LPDIRECT3DDEVICE9 | getDevice () |
| virtual LPDIRECT3D9 | getD3D () |
| virtual void | reset (D3DPRESENT_PARAMETERS &d3dpp)=0 |
| | Reset.
|
| virtual void | setupGenericShaders (GenericShaderType type=GSColor) |
| virtual void | destroyD3DResource (IDirect3DResource9 *d3dResource) |
| virtual F32 | getFillConventionOffset () const |
| | Get the fill convention for this device.
|
| virtual void | doParanoidStateCheck () |
| GFXFence * | createFence () |
| | Allocate a fence.
|
| D3DMULTISAMPLE_TYPE | getMultisampleType () const |
| DWORD | getMultisampleLevel () const |
|
| virtual GFXWindowTarget * | allocWindowTarget (PlatformWindow *window) |
| | Allocate a target for a given window.
|
| virtual GFXTextureTarget * | allocRenderToTextureTarget () |
| | Allocate a target for doing render to texture operations, with no depth/stencil buffer.
|
| virtual void | setActiveRenderTarget (GFXTarget *target) |
| | Start rendering to to a specified render target.
|
Static Public Member Functions |
| static GFXDevice * | createInstance (U32 adapterIndex) |
| static char * | getDXVersion () |
| | Get a string indicating the installed DirectX version, revision and letter number.
|
Public Attributes |
| GFXShader * | mGenericShader [GS_COUNT] |
Static Public Attributes |
| static D3DXFNTable | smD3DX |
Protected Types |
| typedef StrongRefPtr< GFXD3D9VertexBuffer > | RPGDVB |
Protected Member Functions |
| void | reacquireDefaultPoolResources () |
| | To manage creating and re-creating of these when device is aquired.
|
| void | releaseDefaultPoolResources () |
| | To release all resources we control from D3DPOOL_DEFAULT.
|
| void | regenStates () |
| | This you will probably never, ever use, but it is used to generate the code for the initStates() function.
|
| virtual GFXD3D9VertexBuffer * | findVBPool (U32 vertFlags, U32 numVertsNeeded) |
| virtual GFXD3D9VertexBuffer * | createVBPool (U32 vertFlags, U32 vertSize) |
| virtual void | setTextureInternal (U32 textureUnit, const GFXTextureObject *texture) |
| virtual GFXStateBlockRef | createStateBlockInternal (const GFXStateBlockDesc &desc) |
| | Called by GFXDevice to create a device specific stateblock.
|
| virtual void | setStateBlockInternal (GFXStateBlock *block, bool force) |
| | Called by GFXDevice to actually set a stateblock.
|
| virtual void | setShaderConstBufferInternal (GFXShaderConstBuffer *buffer) |
| | Called by base GFXDevice to actually set a const buffer.
|
| virtual void | setLightInternal (U32 lightStage, const GFXLightInfo light, bool lightEnable) |
| virtual void | setLightMaterialInternal (const GFXLightMaterial mat) |
| virtual void | setGlobalAmbientInternal (ColorF color) |
| virtual void | initStates ()=0 |
| | State initialization.
|
| virtual void | _setPrimitiveBuffer (GFXPrimitiveBuffer *buffer) |
| virtual void | drawIndexedPrimitive (GFXPrimitiveType primType, U32 minIndex, U32 numVerts, U32 startIndex, U32 primitiveCount) |
| virtual GFXShader * | createShader (const char *vertFile, const char *pixFile, F32 pixVersion, const Vector< GFXShaderMacro > ¯os) |
| | Creates a shader.
|
| virtual void | destroyShader (GFXShader *shader) |
| | Destroys shader.
|
| virtual D3DPRESENT_PARAMETERS | setupPresentParams (const GFXVideoMode &mode, const HWND &hwnd) const =0 |
| | Device helper function.
|
Static Protected Member Functions |
| static void | initD3DXFnTable () |
Protected Attributes |
| MatrixF | mTempMatrix |
| | Temporary matrix, no assurances on value at all.
|
| D3DVIEWPORT9 | mViewport |
| | Because setViewport gets called a lot, don't want to allocate/unallocate a lot.
|
| RectI | mViewportRect |
| RectI | mClipRect |
| Vector< RPGDVB > | mVolatileVBList |
| IDirect3DSurface9 * | mDeviceBackbuffer |
| IDirect3DSurface9 * | mDeviceDepthStencil |
| IDirect3DSurface9 * | mDeviceColor |
| GFXD3D9VertexBuffer * | mCurrentOpenAllocVB |
| GFXD3D9VertexBuffer * | mCurrentVB |
| void * | mCurrentOpenAllocVertexData |
| StrongRefPtr< GFXD3D9PrimitiveBuffer > | mDynamicPB |
| | Dynamic index buffer.
|
| GFXD3D9PrimitiveBuffer * | mCurrentOpenAllocPB |
| GFXD3D9PrimitiveBuffer * | mCurrentPB |
| IDirect3DVertexShader9 * | mLastVertShader |
| IDirect3DPixelShader9 * | mLastPixShader |
| S32 | mCreateFenceType |
| LPDIRECT3D9 | mD3D |
| | D3D Handle.
|
| LPDIRECT3DDEVICE9 | mD3DDevice |
| | Handle for D3DDevice.
|
| U32 | mAdapterIndex |
| | Adapter index because D3D supports multiple adapters.
|
| GFXD3D9ShaderMgr | mShaderMgr |
| | D3D Shader Manager.
|
| F32 | mPixVersion |
| U32 | mNumSamplers |
| | Profiled (via caps).
|
| D3DMULTISAMPLE_TYPE | mMultisampleType |
| DWORD | mMultisampleLevel |
| StrongRefPtr< GFXD3D9ShaderConstBuffer > | mCurrentConstBuffer |
| | Track the last const buffer we've used.
|
Private Types |
| typedef GFXDevice | Parent |
Friends |
| class | GFXResource |
| class | GFXD3D9PrimitiveBuffer |
| class | GFXD3D9VertexBuffer |
| class | GFXD3D9TextureObject |
| class | GFXD3D9TextureTarget |
| class | GFXD3D9WindowTarget |
Member Typedef Documentation
Constructor & Destructor Documentation
| GFXD3D9Device::GFXD3D9Device |
( |
LPDIRECT3D9 |
d3d, |
|
|
U32 |
index | |
|
) |
| | |
Constructor.
- Parameters:
-
| d3d | Direct3D object to instantiate this device with |
| index | Adapter index since D3D can use multiple graphics adapters |
| virtual GFXD3D9Device::~GFXD3D9Device |
( |
|
) |
[virtual] |
Member Function Documentation
| static void GFXD3D9Device::initD3DXFnTable |
( |
|
) |
[static, protected] |
| void GFXD3D9Device::reacquireDefaultPoolResources |
( |
|
) |
[protected] |
To manage creating and re-creating of these when device is aquired.
| void GFXD3D9Device::releaseDefaultPoolResources |
( |
|
) |
[protected] |
To release all resources we control from D3DPOOL_DEFAULT.
| void GFXD3D9Device::regenStates |
( |
|
) |
[protected] |
This you will probably never, ever use, but it is used to generate the code for the initStates() function.
| void GFXD3D9Device::logVertexBuffers |
( |
|
) |
[protected] |
| virtual void GFXD3D9Device::setTextureInternal |
( |
U32 |
textureUnit, |
|
|
const GFXTextureObject * |
texture | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D9Device::setStateBlockInternal |
( |
GFXStateBlock * |
block, |
|
|
bool |
force | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D9Device::setLightInternal |
( |
U32 |
lightStage, |
|
|
const GFXLightInfo |
light, |
|
|
bool |
lightEnable | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D9Device::setLightMaterialInternal |
( |
const GFXLightMaterial |
mat |
) |
[protected, virtual] |
| virtual void GFXD3D9Device::setGlobalAmbientInternal |
( |
ColorF |
color |
) |
[protected, virtual] |
| virtual void GFXD3D9Device::initStates |
( |
|
) |
[protected, pure virtual] |
| virtual void GFXD3D9Device::drawIndexedPrimitive |
( |
GFXPrimitiveType |
primType, |
|
|
U32 |
minIndex, |
|
|
U32 |
numVerts, |
|
|
U32 |
startIndex, |
|
|
U32 |
primitiveCount | |
|
) |
| | [protected, virtual] |
| virtual GFXShader* GFXD3D9Device::createShader |
( |
const char * |
vertFile, |
|
|
const char * |
pixFile, |
|
|
F32 |
pixVersion, |
|
|
const Vector< GFXShaderMacro > & |
macros | |
|
) |
| | [protected, virtual] |
Creates a shader.
- Parameters:
-
| vertFile | Vertex shader filename |
| pixFile | Pixel shader filename |
| pixVersion | Pixel shader version |
| macros | Macros passed to the shader compiler. |
Implements GFXDevice.
| virtual void GFXD3D9Device::destroyShader |
( |
GFXShader * |
shader |
) |
[protected, virtual] |
Destroys shader.
Reimplemented from GFXDevice.
| virtual D3DPRESENT_PARAMETERS GFXD3D9Device::setupPresentParams |
( |
const GFXVideoMode & |
mode, |
|
|
const HWND & |
hwnd | |
|
) |
| | const [protected, pure virtual] |
| static GFXDevice* GFXD3D9Device::createInstance |
( |
U32 |
adapterIndex |
) |
[static] |
| static char* GFXD3D9Device::getDXVersion |
( |
|
) |
[static] |
Get a string indicating the installed DirectX version, revision and letter number.
| virtual void GFXD3D9Device::preDestroy |
( |
|
) |
[inline, virtual] |
This is called before this, or any other device, is deleted in the global destroy() method.
It allows the device to clean up anything while everything is still valid.
Reimplemented from GFXDevice.
| virtual GFXCubemap* GFXD3D9Device::createCubemap |
( |
|
) |
[virtual] |
| virtual F32 GFXD3D9Device::getPixelShaderVersion |
( |
|
) |
const [inline, virtual] |
| virtual void GFXD3D9Device::setPixelShaderVersion |
( |
F32 |
version |
) |
[inline, virtual] |
| virtual void GFXD3D9Device::disableShaders |
( |
|
) |
[virtual] |
| virtual void GFXD3D9Device::setShader |
( |
GFXShader * |
shader |
) |
[virtual] |
| virtual U32 GFXD3D9Device::getNumSamplers |
( |
|
) |
const [inline, virtual] |
Returns the number of texture samplers that can be used in a shader rendering pass.
Implements GFXDevice.
| virtual bool GFXD3D9Device::beginSceneInternal |
( |
|
) |
[virtual] |
| virtual void GFXD3D9Device::endSceneInternal |
( |
|
) |
[virtual] |
| virtual void GFXD3D9Device::setViewport |
( |
const RectI & |
rect |
) |
[virtual] |
| const RectI & GFXD3D9Device::getViewport |
( |
|
) |
const [inline, virtual] |
| virtual void GFXD3D9Device::setClipRect |
( |
const RectI & |
rect |
) |
[virtual] |
| const RectI & GFXD3D9Device::getClipRect |
( |
|
) |
const [inline, virtual] |
Allocate a target for a given window.
Implements GFXDevice.
| virtual GFXTextureTarget* GFXD3D9Device::allocRenderToTextureTarget |
( |
|
) |
[virtual] |
Allocate a target for doing render to texture operations, with no depth/stencil buffer.
Implements GFXDevice.
Reimplemented in GFX360Device.
| virtual void GFXD3D9Device::setActiveRenderTarget |
( |
GFXTarget * |
target |
) |
[virtual] |
This allocates a vertex buffer and returns a pointer to the allocated buffer.
This function should not be called directly - rather it should be used by the GFXVertexBufferHandle class.
Implements GFXDevice.
This allocates a primitive buffer and returns a pointer to the allocated buffer.
A primitive buffer's type argument refers to the index data - the primitive data will always be preserved from call to call.
- Note:
- All index buffers use 16-bit indices.
Implements GFXDevice.
| virtual U32 GFXD3D9Device::getMaxDynamicVerts |
( |
|
) |
[inline, virtual] |
| virtual U32 GFXD3D9Device::getMaxDynamicIndices |
( |
|
) |
[inline, virtual] |
| virtual LPDIRECT3DDEVICE9 GFXD3D9Device::getDevice |
( |
|
) |
[inline, virtual] |
| virtual LPDIRECT3D9 GFXD3D9Device::getD3D |
( |
|
) |
[inline, virtual] |
| virtual void GFXD3D9Device::reset |
( |
D3DPRESENT_PARAMETERS & |
d3dpp |
) |
[pure virtual] |
| virtual void GFXD3D9Device::destroyD3DResource |
( |
IDirect3DResource9 * |
d3dResource |
) |
[inline, virtual] |
| virtual F32 GFXD3D9Device::getFillConventionOffset |
( |
|
) |
const [inline, virtual] |
Get the fill convention for this device.
Implements GFXDevice.
| virtual void GFXD3D9Device::doParanoidStateCheck |
( |
|
) |
[virtual] |
| GFXFence* GFXD3D9Device::createFence |
( |
|
) |
[virtual] |
Allocate a fence.
The API specific implementation of GFXDevice is responsible to make sure that the proper type is used. GFXGeneralFence should work in all cases.
Implements GFXDevice.
| D3DMULTISAMPLE_TYPE GFXD3D9Device::getMultisampleType |
( |
|
) |
const [inline] |
| DWORD GFXD3D9Device::getMultisampleLevel |
( |
|
) |
const [inline] |
Friends And Related Function Documentation
Member Data Documentation
Temporary matrix, no assurances on value at all.
Because setViewport gets called a lot, don't want to allocate/unallocate a lot.
Adapter index because D3D supports multiple adapters.
To keep track of how many are allocated and freed.
Track the last const buffer we've used.
Used to notify new constant buffers that they should send all of their constants up
|