GFXD3D8Device Class Reference#include <gfxD3D8Device.h>
Inheritance diagram for GFXD3D8Device:
[legend]List of all members.
|
Debug Vertex Buffer information/management |
| void | addVertexBuffer (GFXD3D8VertexBuffer *buffer) |
| void | removeVertexBuffer (GFXD3D8VertexBuffer *buffer) |
| void | logVertexBuffers () |
| U32 | mNumAllocatedVertexBuffers |
| | To keep track of how many are allocated and freed.
|
| GFXD3D8VertexBuffer * | mVBListHead |
Public Member Functions |
| GFXTextureObject * | createRenderSurface (U32 width, U32 height, GFXFormat format, U32 mipLevel) |
| | GFXD3D8Device (IDirect3D8 *d3d, U32 index) |
| | Constructor.
|
| | ~GFXD3D8Device () |
| virtual void | init (const GFXVideoMode &mode, PlatformWindow *window=NULL) |
| | 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 | enterDebugEvent (ColorI color, const char *name) |
| virtual void | leaveDebugEvent () |
| virtual void | setDebugMarker (ColorI color, const char *name) |
| void | enumerateVideoModes () |
| void | setVideoMode (const GFXVideoMode &mode) |
| virtual GFXFormat | selectSupportedFormat (GFXTextureProfile *profile, const Vector< GFXFormat > &formats, bool texture, bool mustblend) |
| void | clear (U32 flags, ColorI color, F32 z, U32 stencil) |
| bool | beginSceneInternal () |
| void | endSceneInternal () |
| void | setViewport (const RectI &rect) |
| const RectI & | getViewport () const |
| void | setClipRect (const RectI &rect) |
| const RectI & | getClipRect () const |
| virtual GFXTextureTarget * | allocRenderToTextureTarget () |
| | Allocate a target for doing render to texture operations, with no depth/stencil buffer.
|
| virtual GFXWindowTarget * | allocWindowTarget (PlatformWindow *window) |
| | Allocate a target for a given window.
|
| virtual void | pushActiveRenderTarget () |
| | Save current render target states - note this works with MRT's.
|
| virtual void | popActiveRenderTarget () |
| | Restore all render targets - supports MRT's.
|
| virtual void | setActiveRenderTarget (GFXTarget *target) |
| | Start rendering to to a specified render target.
|
| virtual GFXTarget * | getActiveRenderTarget () |
| | Return a pointer to the current active render target.
|
| void | setVB (GFXVertexBuffer *buffer) |
| GFXVertexBuffer * | allocVertexBuffer (U32 numVerts, U32 vertFlags, U32 vertSize, GFXBufferType bufferType) |
| | This allocates a vertex buffer and returns a pointer to the allocated buffer.
|
| GFXPrimitiveBuffer * | allocPrimitiveBuffer (U32 numIndices, U32 numPrimitives, GFXBufferType bufferType) |
| | This allocates a primitive buffer and returns a pointer to the allocated buffer.
|
| void | deallocVertexBuffer (GFXD3D8VertexBuffer *vertBuff) |
| void | zombifyTextureManager () |
| void | resurrectTextureManager () |
| U32 | getMaxDynamicVerts () |
| U32 | getMaxDynamicIndices () |
| void | drawPrimitive (GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount) |
| IDirect3DDevice8 * | getDevice () |
| D3DPRESENT_PARAMETERS | setupPresentParams (const GFXVideoMode &mode, const HWND &hwnd) |
| | Device helper function.
|
| void | reset (D3DPRESENT_PARAMETERS &d3dpp) |
| | Reset.
|
| F32 | getFillConventionOffset () const |
| | Get the fill convention for this device.
|
| GFXFence * | createFence () |
| | Allocate a fence.
|
Static Public Member Functions |
| static GFXDevice * | createInstance (U32 adapterIndex) |
| static char * | getDXVersion () |
| | Get a string indicating the installed DirectX version, revision and letter number.
|
| static void | enumerateAdapters (Vector< GFXAdapter * > &adapterList) |
Static Public Attributes |
| static D3D8XFNTable | smD3DX |
Protected Member Functions |
| 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 | setTextureInternal (U32 textureUnit, const GFXTextureObject *texture) |
| virtual void | setLightInternal (U32 lightStage, const GFXLightInfo light, bool lightEnable) |
| virtual void | setLightMaterialInternal (const GFXLightMaterial mat) |
| virtual void | setGlobalAmbientInternal (ColorF color) |
| void | setMatrix (GFXMatrixType mtype, const MatrixF &mat) |
| | This function must be implemented differently per API and it should set ONLY the current matrix.
|
| void | initStates () |
| | State initialization.
|
| GFXVertexBuffer * | allocVB (U32 numVerts, void **vertexPtr, U32 vertFlags, U32 vertSize) |
| GFXVertexBuffer * | allocPooledVB (U32 numVerts, void **vertexPtr, U32 vertFlags, U32 vertSize) |
| GFXPrimitiveBuffer * | allocPB (U32 numIndices, void **indexPtr) |
| GFXPrimitiveBuffer * | allocPooledPB (U32 numIndices, void **indexPtr) |
| void | setPrimitiveBuffer (GFXPrimitiveBuffer *buffer) |
| 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.
|
Static Protected Attributes |
| static GFXAdapter::CreateDeviceInstanceDelegate | mCreateDeviceInstance |
Private Types |
| typedef GFXDevice | Parent |
| typedef StrongRefPtr< GFXD3D8VertexBuffer > | RPGDVB |
Private Member Functions |
| virtual void | copyBBToSfxBuff () |
| | Special effects back buffer - for refraction and other effects.
|
| 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.
|
| GFXD3D8VertexBuffer * | findVBPool (U32 vertFlags) |
| GFXD3D8VertexBuffer * | createVBPool (U32 vertFlags, U32 vertSize) |
Static Private Member Functions |
| static void | initD3DXFnTable () |
Private Attributes |
| MatrixF | mTempMatrix |
| | Temporary matrix, no assurances on value at all.
|
| _D3DVIEWPORT8 * | mViewport |
| | Because setViewport gets called a lot, don't want to allocate/unallocate a lot.
|
| RectI | mViewportRect |
| RectI | mClipRect |
| IDirect3DSurface8 * | mDepthStencil |
| Vector< RPGDVB > | mVolatileVBList |
| GFXD3D8VertexBuffer * | mCurrentOpenAllocVB |
| GFXD3D8VertexBuffer * | mCurrentVB |
| void * | mCurrentOpenAllocVertexData |
| StrongRefPtr< GFXD3D8PrimitiveBuffer > | mDynamicPB |
| | Dynamic index buffer.
|
| GFXD3D8PrimitiveBuffer * | mCurrentOpenAllocPB |
| GFXD3D8PrimitiveBuffer * | mCurrentPB |
| IDirect3D8 * | mD3D |
| | D3D Handle.
|
| IDirect3DDevice8 * | mD3DDevice |
| | Handle for D3DDevice.
|
| GFXFormat | mBackbufferFormat |
| | Our backbuffer format.
|
| U32 | mAdapterIndex |
| | Adapter index because D3D supports multiple adapters.
|
| GFXD3D8ShaderMgr | mShaderMgr |
| | D3D Shader Manager.
|
| F32 | mPixVersion |
| U32 | mNumSamplers |
Friends |
| class | GFXD3D8PrimitiveBuffer |
| class | GFXD3D8VertexBuffer |
| class | GFXD3D8TextureObject |
Member Typedef Documentation
Constructor & Destructor Documentation
| GFXD3D8Device::GFXD3D8Device |
( |
IDirect3D8 * |
d3d, |
|
|
U32 |
index | |
|
) |
| | |
Constructor.
- Parameters:
-
| d3d | Direct3D object to instantiate this device with |
| index | Adapter index since D3D can use multiple graphics adapters |
| GFXD3D8Device::~GFXD3D8Device |
( |
|
) |
|
Member Function Documentation
| static void GFXD3D8Device::initD3DXFnTable |
( |
|
) |
[static, private] |
| virtual void GFXD3D8Device::copyBBToSfxBuff |
( |
|
) |
[private, virtual] |
Special effects back buffer - for refraction and other effects.
Implements GFXDevice.
| void GFXD3D8Device::reacquireDefaultPoolResources |
( |
|
) |
[private] |
To manage creating and re-creating of these when device is aquired.
| void GFXD3D8Device::releaseDefaultPoolResources |
( |
|
) |
[private] |
To release all resources we control from D3DPOOL_DEFAULT.
| void GFXD3D8Device::regenStates |
( |
|
) |
[private] |
This you will probably never, ever use, but it is used to generate the code for the initStates() function.
| void GFXD3D8Device::logVertexBuffers |
( |
|
) |
[private] |
| virtual void GFXD3D8Device::setStateBlockInternal |
( |
GFXStateBlock * |
block, |
|
|
bool |
force | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D8Device::setTextureInternal |
( |
U32 |
textureUnit, |
|
|
const GFXTextureObject * |
texture | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D8Device::setLightInternal |
( |
U32 |
lightStage, |
|
|
const GFXLightInfo |
light, |
|
|
bool |
lightEnable | |
|
) |
| | [protected, virtual] |
| virtual void GFXD3D8Device::setLightMaterialInternal |
( |
const GFXLightMaterial |
mat |
) |
[protected, virtual] |
| virtual void GFXD3D8Device::setGlobalAmbientInternal |
( |
ColorF |
color |
) |
[protected, virtual] |
This function must be implemented differently per API and it should set ONLY the current matrix.
For example, in OpenGL, there should be NO matrix stack activity, all the stack stuff is managed in the GFX layer.
OpenGL does not have separate world and view matrices. It has ModelView which is world * view. You must take this into consideration.
- Parameters:
-
| mtype | Which matrix to set, world/view/projection |
| mat | Matrix to assign |
Implements GFXDevice.
| void GFXD3D8Device::initStates |
( |
|
) |
[protected, virtual] |
State initialization.
This MUST BE CALLED in setVideoMode after the device is created.
Implements GFXDevice.
| virtual GFXShader* GFXD3D8Device::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.
| static GFXDevice* GFXD3D8Device::createInstance |
( |
U32 |
adapterIndex |
) |
[static] |
| static char* GFXD3D8Device::getDXVersion |
( |
|
) |
[static] |
Get a string indicating the installed DirectX version, revision and letter number.
Initialize this GFXDevice, optionally specifying a platform window to bind to.
Implements GFXDevice.
| virtual void GFXD3D8Device::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.
Returns active graphics adapter type.
Implements GFXDevice.
| virtual GFXCubemap* GFXD3D8Device::createCubemap |
( |
|
) |
[virtual] |
| virtual F32 GFXD3D8Device::getPixelShaderVersion |
( |
|
) |
const [inline, virtual] |
| virtual void GFXD3D8Device::setPixelShaderVersion |
( |
F32 |
version |
) |
[inline, virtual] |
| virtual void GFXD3D8Device::disableShaders |
( |
|
) |
[virtual] |
| virtual void GFXD3D8Device::setShader |
( |
GFXShader * |
shader |
) |
[virtual] |
| virtual U32 GFXD3D8Device::getNumSamplers |
( |
|
) |
const [inline, virtual] |
Returns the number of texture samplers that can be used in a shader rendering pass.
Implements GFXDevice.
| virtual void GFXD3D8Device::enterDebugEvent |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [virtual] |
| virtual void GFXD3D8Device::leaveDebugEvent |
( |
|
) |
[virtual] |
| virtual void GFXD3D8Device::setDebugMarker |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [virtual] |
| void GFXD3D8Device::enumerateVideoModes |
( |
|
) |
[virtual] |
| bool GFXD3D8Device::beginSceneInternal |
( |
|
) |
[virtual] |
| void GFXD3D8Device::endSceneInternal |
( |
|
) |
[virtual] |
| void GFXD3D8Device::setViewport |
( |
const RectI & |
rect |
) |
[virtual] |
| const RectI & GFXD3D8Device::getViewport |
( |
|
) |
const [inline, virtual] |
| void GFXD3D8Device::setClipRect |
( |
const RectI & |
rect |
) |
[virtual] |
| const RectI & GFXD3D8Device::getClipRect |
( |
|
) |
const [inline, virtual] |
| virtual GFXTextureTarget* GFXD3D8Device::allocRenderToTextureTarget |
( |
|
) |
[virtual] |
Allocate a target for doing render to texture operations, with no depth/stencil buffer.
Implements GFXDevice.
Allocate a target for a given window.
Implements GFXDevice.
| virtual void GFXD3D8Device::pushActiveRenderTarget |
( |
|
) |
[virtual] |
Save current render target states - note this works with MRT's.
Reimplemented from GFXDevice.
| virtual void GFXD3D8Device::popActiveRenderTarget |
( |
|
) |
[virtual] |
Restore all render targets - supports MRT's.
Reimplemented from GFXDevice.
| virtual void GFXD3D8Device::setActiveRenderTarget |
( |
GFXTarget * |
target |
) |
[virtual] |
Start rendering to to a specified render target.
Implements GFXDevice.
| virtual GFXTarget* GFXD3D8Device::getActiveRenderTarget |
( |
|
) |
[virtual] |
Return a pointer to the current active render target.
Reimplemented from GFXDevice.
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.
| void GFXD3D8Device::zombifyTextureManager |
( |
|
) |
|
| void GFXD3D8Device::resurrectTextureManager |
( |
|
) |
|
| U32 GFXD3D8Device::getMaxDynamicVerts |
( |
|
) |
[inline, virtual] |
| U32 GFXD3D8Device::getMaxDynamicIndices |
( |
|
) |
[inline, virtual] |
| IDirect3DDevice8* GFXD3D8Device::getDevice |
( |
|
) |
[inline] |
| D3DPRESENT_PARAMETERS GFXD3D8Device::setupPresentParams |
( |
const GFXVideoMode & |
mode, |
|
|
const HWND & |
hwnd | |
|
) |
| | |
| void GFXD3D8Device::reset |
( |
D3DPRESENT_PARAMETERS & |
d3dpp |
) |
|
| F32 GFXD3D8Device::getFillConventionOffset |
( |
|
) |
const [inline, virtual] |
Get the fill convention for this device.
Implements GFXDevice.
| GFXFence* GFXD3D8Device::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.
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.
|