0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008:
0009:
0010:
0011:
0012:
0013:
0014:
0015: struct UserInput
0016: {
0017: BOOL bRotateUp;
0018: BOOL bRotateDown;
0019: BOOL bRotateLeft;
0020: BOOL bRotateRight;
0021: BOOL bZ;
0022: BOOL bX;
0023: };
0024:
0025:
0026:
0027:
0028:
0029:
0030:
0031:
0032: class CMyD3DApplication : public CD3DApplication
0033: {
0034: CD3DMesh *m_pMesh;
0035: CD3DMesh *m_pMeshBg;
0036: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0037: LPD3DXEFFECT m_pEffect;
0038: D3DXHANDLE m_hmWVP;
0039: D3DXHANDLE m_hmWVPT;
0040: D3DXHANDLE m_hvCol;
0041: D3DXHANDLE m_hvDir;
0042:
0043: LPDIRECT3DSURFACE9 m_pMapZ;
0044: LPDIRECT3DTEXTURE9 m_pColorMap;
0045: LPDIRECT3DSURFACE9 m_pColorMapSurf;
0046: LPDIRECT3DTEXTURE9 m_pDepthMap;
0047: LPDIRECT3DSURFACE9 m_pDepthMapSurf;
0048: LPDIRECT3DTEXTURE9 m_pFogMap;
0049: LPDIRECT3DSURFACE9 m_pFogMapSurf;
0050:
0051: DWORD m_Width;
0052: DWORD m_Height;
0053: UINT m_MapW;
0054: UINT m_MapH;
0055:
0056: D3DXMATRIX m_mWorld;
0057: D3DXMATRIX m_mView;
0058: D3DXMATRIX m_mProj;
0059: D3DXVECTOR4 m_LightDir;
0060:
0061: FLOAT m_zoom;
0062: FLOAT m_fWorldRotX;
0063: FLOAT m_fWorldRotY;
0064:
0065: BOOL m_bLoadingApp;
0066: CD3DFont* m_pFont;
0067: UserInput m_UserInput;
0068:
0069: protected:
0070: virtual HRESULT OneTimeSceneInit();
0071: virtual HRESULT InitDeviceObjects();
0072: virtual HRESULT RestoreDeviceObjects();
0073: virtual HRESULT InvalidateDeviceObjects();
0074: virtual HRESULT DeleteDeviceObjects();
0075: virtual HRESULT Render();
0076: virtual HRESULT FrameMove();
0077: virtual HRESULT FinalCleanup();
0078: virtual HRESULT ConfirmDevice(D3DCAPS9*, DWORD, D3DFORMAT);
0079:
0080: HRESULT RenderText();
0081:
0082: void UpdateInput( UserInput* pUserInput );
0083: public:
0084: LRESULT MsgProc( HWND hWnd, UINT msg
0085: , WPARAM wParam, LPARAM lParam );
0086: CMyD3DApplication();
0087: virtual ~CMyD3DApplication();
0088: };
0089: