Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GameDX.h

00001 
00007 #ifndef _GAMEDX_H_
00008 #define _GAMEDX_H_
00009 
00010 #include "global.h"
00011 
00012 class Window;
00013 class GameDXListener;
00014 
00018 class GameDX {
00019 
00020 public:
00025     GameDX();
00026 
00031     ~GameDX();
00032 
00033 
00034 public:
00041     void setupD3D();
00042 
00048     LPDIRECT3DDEVICE8 & getDeviceHandle();
00049 
00055     LPDIRECT3D8 & getD3D();
00056 
00062     D3DRECT & getClientSurfaceCoords();
00063 
00069     LPD3DXFONT & getFont();
00070 
00074     const D3DCAPS8& getCaps() const;
00075 
00080     void releaseD3D();
00081 
00093     void resetD3D();
00094 
00100     void Clear();
00101 
00107     void SetClearColor( D3DCOLOR color );
00108 
00118     void SetTransform( D3DTRANSFORMSTATETYPE state, const D3DXMATRIX* pMatrix );
00119 
00125     void SetLight( DWORD index, const D3DLIGHT8* pLight );
00126 
00132     void LightEnable( DWORD LightIndex, BOOL bEnable );
00133 
00137     void SetDefaultMaterial( const D3DMATERIAL8* );
00138 
00145     void RestoreDefaultMaterial();
00146 
00151     void registerListener( GameDXListener& listener );
00152 
00158     void removeListener( GameDXListener& listener );
00159 
00160 private:
00161 
00167     void setupState();
00168 
00172     void generateLostEvent();
00173 
00177     void generateResetEvent();
00178 
00183     HRESULT setupPresentParams( bool isWindowed );
00184 
00185 private:
00186 
00191     D3DDISPLAYMODE d3ddm;
00192 
00197     D3DPRESENT_PARAMETERS d3dpp;
00198 
00203     LPDIRECT3D8 m_pd3d;
00204 
00209     LPDIRECT3DDEVICE8 m_pd3dDevice;
00210 
00215     LPD3DXFONT m_pd3dFont;
00216 
00217     typedef std::vector< GameDXListener* > LVector; //Listener Vector
00218     typedef LVector::iterator LVectorIter;          //Listener Vector iterator
00219 
00220     LVector listeners;
00221 
00222     D3DXMATRIX worldMat;
00223     D3DXMATRIX viewMat;
00224     D3DXMATRIX projMat;
00225 
00226     D3DMATERIAL8 defaultMat;
00227 
00228     D3DLIGHT8* lights;
00229     bool* lightEnabled;
00230 
00231     D3DCOLOR clearColor;
00232 
00233     D3DCAPS8 devCaps;
00234 };
00235 
00236 #endif

Generated on Wed May 14 01:38:07 2003 for CG Skeletal Animation Project by doxygen1.2.18