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