Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GameDX Class Reference

A container that holds and initializes all the DirectX objects. More...

#include <GameDX.h>

List of all members.

Public Methods

 GameDX ()
 Constructor.

 ~GameDX ()
 Destructor.

void setupD3D ()
 Sets up Direct3D.

LPDIRECT3DDEVICE8 & getDeviceHandle ()
 Gets a handle to the Direct3D device.

LPDIRECT3D8 & getD3D ()
 Gets a reference to the Direct3D object.

D3DRECT & getClientSurfaceCoords ()
 Gets a reference to the client surface coordinates.

LPD3DXFONT & getFont ()
 Gets a reference to a DirectX Font object.

const D3DCAPS8 & getCaps () const
 Returns the capabilities of the current device.

void releaseD3D ()
 Releases all objects created for Direct3D.

void resetD3D ()
 After setting up the D3D device, this resets the device, picking up the windowed mode from the global window.

void Clear ()
 Performs a clear of the D3D surface and z-buffer.

void SetClearColor (D3DCOLOR color)
 Sets the clear color to be used in Clear.

void SetTransform (D3DTRANSFORMSTATETYPE state, const D3DXMATRIX *pMatrix)
 Sets the transform on this device.

void SetLight (DWORD index, const D3DLIGHT8 *pLight)
 Sets the light, saving state in case of device transitions.

void LightEnable (DWORD LightIndex, BOOL bEnable)
 Enables or disables the light, saving state in case of device transitions.

void SetDefaultMaterial (const D3DMATERIAL8 *)
 Sets the default material, but does not set it on the device.

void RestoreDefaultMaterial ()
 Restores the default material by setting's the device's current material to the default material.

void registerListener (GameDXListener &listener)
 Ensures that the listener given is registered.

void removeListener (GameDXListener &listener)
 Removes the given listener from the list of registered listeners, so that it will no longer receive events.


Detailed Description

A container that holds and initializes all the DirectX objects.


Member Function Documentation

void GameDX::Clear  
 

Performs a clear of the D3D surface and z-buffer.

Exceptions:
GameException  on failure

D3DRECT & GameDX::getClientSurfaceCoords  
 

Gets a reference to the client surface coordinates.

Returns:
a reference to the client surface coordinates

LPDIRECT3D8 & GameDX::getD3D  
 

Gets a reference to the Direct3D object.

Returns:
a reference to the Direct3D object

LPDIRECT3DDEVICE8 & GameDX::getDeviceHandle  
 

Gets a handle to the Direct3D device.

Returns:
a handle to the Direct3D device

LPD3DXFONT & GameDX::getFont  
 

Gets a reference to a DirectX Font object.

Returns:
a reference to a DirectX Font object

void GameDX::LightEnable DWORD    LightIndex,
BOOL    bEnable
 

Enables or disables the light, saving state in case of device transitions.

Exceptions:
GameException  on failure

void GameDX::registerListener GameDXListener   listener
 

Ensures that the listener given is registered.

If the given listener has already registered, this method has no effect.

void GameDX::removeListener GameDXListener   listener
 

Removes the given listener from the list of registered listeners, so that it will no longer receive events.

If the given listener is not in the list, this method will have no effect.

void GameDX::resetD3D  
 

After setting up the D3D device, this resets the device, picking up the windowed mode from the global window.

This works essentially the same as setupD3D, except that it allows re-initialization after a setupD3D call.

D3DPOOL_MANAGED textures and objects will remain between resets, but not between a release/setup call pair.

Exceptions:
GameException  on failure

void GameDX::RestoreDefaultMaterial  
 

Restores the default material by setting's the device's current material to the default material.

Exceptions:
GameException  on failure

void GameDX::SetClearColor D3DCOLOR    color
 

Sets the clear color to be used in Clear.

This also sets the fog color.

Exceptions:
GameException  on failure

void GameDX::SetLight DWORD    index,
const D3DLIGHT8 *    pLight
 

Sets the light, saving state in case of device transitions.

Exceptions:
GameException  on failure

void GameDX::SetTransform D3DTRANSFORMSTATETYPE    state,
const D3DXMATRIX *    pMatrix
 

Sets the transform on this device.

Using this method ensures that the matrix will be saved between device lost/reset transitions. For view and projection matrices, you should use this method. For world matricies that change only mid-frame, set the matrix directly with the device, and set only the starting world matrix with this method.

Exceptions:
GameException  on failure

void GameDX::setupD3D  
 

Sets up Direct3D.

Returns:
the result
Exceptions:
GameException  on failure


The documentation for this class was generated from the following files:
Generated on Wed May 14 01:38:08 2003 for CG Skeletal Animation Project by doxygen1.2.18