0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008:
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_pMesh;
0034: CD3DMesh *m_pMeshBg;
0035:
0036:
0037: LPD3DXEFFECT m_pEffect;
0038: D3DXHANDLE m_hTechnique;
0039: D3DXHANDLE m_htSrcMap;
0040: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0041:
0042:
0043: LPDIRECT3DSURFACE9 m_pMapZ;
0044: LPDIRECT3DTEXTURE9 m_pSatTex;
0045: LPDIRECT3DSURFACE9 m_pSatSurf;
0046:
0047:
0048: D3DXMATRIX m_mWorld;
0049: D3DXMATRIX m_mView;
0050: D3DXMATRIX m_mProj;
0051:
0052: BOOL m_bLoadingApp;
0053: CD3DFont* m_pFont;
0054: UserInput m_UserInput;
0055:
0056: FLOAT m_fWorldRotX;
0057: FLOAT m_fWorldRotY;
0058: FLOAT m_fViewZoom;
0059:
0060: protected:
0061: virtual HRESULT OneTimeSceneInit();
0062: virtual HRESULT InitDeviceObjects();
0063: virtual HRESULT RestoreDeviceObjects();
0064: virtual HRESULT InvalidateDeviceObjects();
0065: virtual HRESULT DeleteDeviceObjects();
0066: virtual HRESULT Render();
0067: virtual HRESULT FrameMove();
0068: virtual HRESULT FinalCleanup();
0069: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0070:
0071: HRESULT RenderText();
0072:
0073: void UpdateInput( UserInput* pUserInput );
0074: public:
0075: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0076: CMyD3DApplication();
0077: virtual ~CMyD3DApplication();
0078: };
0079:
0080: