GFX360Device Class Reference

#include <gfx360Device.h>

Inheritance diagram for GFX360Device:

Inheritance graph
[legend]
List of all members.

Predicated Tiling Targets

void clearTextureHolds ()
 This goes through all the TUs and sets their textures to NULL, then updates the GFX state to reflect this.
void beginTiling ()
void endTiling (GFXTextureObject *resolveSurface, bool clearRT, bool clearDepth)
void resolveTiling (GFXTextureObject *surface, bool clearRT, bool clearDepth)
void resolve (GFXTextureObject *surface, RectI &srcRect, bool clearRT, bool clearDepth)
Vector< D3DResource * > mResourceFreeList
 This is a list of resources which will be destroyed during endScene() instead of when requested due to tiling.
IDirect3DSurface9 * mTilingRenderTarget
IDirect3DSurface9 * mTilingDepthStencil
IDirect3DSurface9 * mOffscreenRenderTarget
IDirect3DSurface9 * mOffscreenDepthStencil
D3DSURFACE_PARAMETERS mTempSurfaceParameters
bool mIsTilingRightNow

Public Member Functions

 GFX360Device (LPDIRECT3D9 d3d, U32 index)
virtual ~GFX360Device ()
Overrides
virtual void init (const GFXVideoMode &mode, PlatformWindow *window=NULL)
 Initialize this GFXDevice, optionally specifying a platform window to bind to.
virtual void enumerateVideoModes ()
virtual GFXAdapterType getAdapterType ()
 Returns active graphics adapter type.
virtual GFXFormat selectSupportedFormat (GFXTextureProfile *profile, const Vector< GFXFormat > &formats, bool texture, bool mustblend)
virtual void beginScene ()
virtual void endScene ()
virtual void swapBuffers ()
virtual void copyBBToSfxBuff ()
virtual D3DPRESENT_PARAMETERS setupPresentParams (const GFXVideoMode &mode)
virtual void destroyD3DResource (IDirect3DResource9 *d3dResource)
virtual void setMatrix (GFXMatrixType mtype, const MatrixF &mat)
 This function must be implemented differently per API and it should set ONLY the current matrix.
virtual void setTextureStageState (U32 stage, U32 state, U32 value)
virtual void setRenderState (U32 state, U32 value)
virtual void initStates ()
 State initialization.
virtual void setupGenericShaders (GenericShaderType type=GSColor)
virtual void reset (D3DPRESENT_PARAMETERS &d3dpp)
 Reset.
Render Target Overrides
virtual GFXTextureTargetallocRenderToTextureTarget ()
 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.
Debug Events -- Not supported on 360? Do research on 360 PIX. -patw
virtual void enterDebugEvent (ColorI color, const char *name)
virtual void leaveDebugEvent ()
virtual void setDebugMarker (ColorI color, const char *name)

Protected Member Functions

virtual GFXD3D9VertexBufferfindVBPool (U32 vertFlags, U32 numVertsNeeded)
virtual GFXD3D9VertexBuffercreateVBPool (U32 vertFlags, U32 vertSize)
virtual void _beginBin ()
virtual void _endBin ()
virtual void _resolveActiveRenderTarget ()
void drawScreenRect (RectI &rect, IDirect3DTexture9 *colorTex, IDirect3DTexture9 *depthTex=NULL)

Private Types

typedef GFXD3D9Device Parent
typedef Vector< RPGDVBVectorRPGDVB
 SSShaderPT = 0
 SSShaderCount
enum  GFX360ScreenSpaceShader {
  SSShaderPT = 0,
  SSShaderCount
}

Private Member Functions

void initGenericShaders ()
 Helper function to load up the generic shaders through the shader manager.
U32 insertFence ()
void blockOnFence (U32 fenceID)

Private Attributes

Vector< RPGDVBmClearAtFrameEnd
Vector< VectorRPGDVBm360VolatileVBList
GFXShadermScreenSpaceShader [SSShaderCount]
GFXTexHandle mDeviceDepthStencilTex
clear() parameters, since the clear call is made differently
F32 mZClear
U32 mStencilClear
D3DVECTOR4 mClearColor

Friends

class GFX360TextureTarget

Member Typedef Documentation

Reimplemented from GFXD3D9Device.


Member Enumeration Documentation

Enumerator:
SSShaderPT 
SSShaderCount 


Constructor & Destructor Documentation

GFX360Device::GFX360Device ( LPDIRECT3D9  d3d,
U32  index 
)

virtual GFX360Device::~GFX360Device (  )  [virtual]


Member Function Documentation

void GFX360Device::clearTextureHolds (  )  [private]

This goes through all the TUs and sets their textures to NULL, then updates the GFX state to reflect this.

Reason: Tiling restrictions.

void GFX360Device::beginTiling (  )  [private]

void GFX360Device::endTiling ( GFXTextureObject resolveSurface,
bool  clearRT,
bool  clearDepth 
) [private]

void GFX360Device::resolveTiling ( GFXTextureObject surface,
bool  clearRT,
bool  clearDepth 
) [private]

void GFX360Device::resolve ( GFXTextureObject surface,
RectI srcRect,
bool  clearRT,
bool  clearDepth 
) [private]

void GFX360Device::initGenericShaders (  )  [private]

Helper function to load up the generic shaders through the shader manager.

U32 GFX360Device::insertFence (  )  [inline, private]

void GFX360Device::blockOnFence ( U32  fenceID  )  [inline, private]

virtual GFXD3D9VertexBuffer* GFX360Device::findVBPool ( U32  vertFlags,
U32  numVertsNeeded 
) [protected, virtual]

Reimplemented from GFXD3D9Device.

virtual GFXD3D9VertexBuffer* GFX360Device::createVBPool ( U32  vertFlags,
U32  vertSize 
) [protected, virtual]

Reimplemented from GFXD3D9Device.

virtual void GFX360Device::_beginBin (  )  [protected, virtual]

virtual void GFX360Device::_endBin (  )  [protected, virtual]

virtual void GFX360Device::_resolveActiveRenderTarget (  )  [protected, virtual]

void GFX360Device::drawScreenRect ( RectI rect,
IDirect3DTexture9 *  colorTex,
IDirect3DTexture9 *  depthTex = NULL 
) [protected]

virtual void GFX360Device::init ( const GFXVideoMode mode,
PlatformWindow window = NULL 
) [virtual]

Initialize this GFXDevice, optionally specifying a platform window to bind to.

Implements GFXD3D9Device.

virtual void GFX360Device::enumerateVideoModes (  )  [virtual]

Implements GFXDevice.

virtual GFXAdapterType GFX360Device::getAdapterType (  )  [inline, virtual]

Returns active graphics adapter type.

Reimplemented from GFXD3D9Device.

virtual GFXFormat GFX360Device::selectSupportedFormat ( GFXTextureProfile profile,
const Vector< GFXFormat > &  formats,
bool  texture,
bool  mustblend 
) [virtual]

Implements GFXDevice.

virtual void GFX360Device::beginScene (  )  [virtual]

Reimplemented from GFXDevice.

virtual void GFX360Device::endScene (  )  [virtual]

Reimplemented from GFXDevice.

virtual void GFX360Device::swapBuffers (  )  [virtual]

virtual void GFX360Device::copyBBToSfxBuff (  )  [virtual]

Implements GFXDevice.

virtual D3DPRESENT_PARAMETERS GFX360Device::setupPresentParams ( const GFXVideoMode mode  )  [virtual]

virtual void GFX360Device::destroyD3DResource ( IDirect3DResource9 *  d3dResource  )  [virtual]

Reimplemented from GFXD3D9Device.

virtual void GFX360Device::setMatrix ( GFXMatrixType  mtype,
const MatrixF mat 
) [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.

virtual void GFX360Device::setTextureStageState ( U32  stage,
U32  state,
U32  value 
) [virtual]

virtual void GFX360Device::setRenderState ( U32  state,
U32  value 
) [virtual]

virtual void GFX360Device::initStates (  )  [virtual]

State initialization.

This MUST BE CALLED in setVideoMode after the device is created.

Implements GFXD3D9Device.

virtual void GFX360Device::setupGenericShaders ( GenericShaderType  type = GSColor  )  [virtual]

Reimplemented from GFXD3D9Device.

virtual void GFX360Device::reset ( D3DPRESENT_PARAMETERS &  d3dpp  )  [inline, virtual]

Reset.

Implements GFXD3D9Device.

virtual GFXTextureTarget* GFX360Device::allocRenderToTextureTarget (  )  [virtual]

Allocate a target for doing render to texture operations, with no depth/stencil buffer.

Reimplemented from GFXD3D9Device.

virtual void GFX360Device::setActiveRenderTarget ( GFXTarget target  )  [virtual]

Start rendering to to a specified render target.

Reimplemented from GFXD3D9Device.

virtual void GFX360Device::enterDebugEvent ( ColorI  color,
const char *  name 
) [inline, virtual]

Implements GFXDevice.

virtual void GFX360Device::leaveDebugEvent (  )  [inline, virtual]

Implements GFXDevice.

virtual void GFX360Device::setDebugMarker ( ColorI  color,
const char *  name 
) [inline, virtual]

Implements GFXDevice.


Friends And Related Function Documentation

friend class GFX360TextureTarget [friend]


Member Data Documentation

GFXShader* GFX360Device::mScreenSpaceShader[SSShaderCount] [private]

Vector<D3DResource *> GFX360Device::mResourceFreeList [private]

This is a list of resources which will be destroyed during endScene() instead of when requested due to tiling.

IDirect3DSurface9* GFX360Device::mTilingRenderTarget [private]

IDirect3DSurface9* GFX360Device::mTilingDepthStencil [private]

IDirect3DSurface9* GFX360Device::mOffscreenRenderTarget [private]

IDirect3DSurface9* GFX360Device::mOffscreenDepthStencil [private]

D3DSURFACE_PARAMETERS GFX360Device::mTempSurfaceParameters [private]

D3DVECTOR4 GFX360Device::mClearColor [private]