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: BOOL bDispersionUp;
0023: BOOL bDispersionDown;
0024: };
0025:
0026:
0027:
0028:
0029:
0030:
0031:
0032:
0033: class CMyD3DApplication : public CD3DApplication
0034: {
0035: BOOL m_bCreate;
0036:
0037: CD3DMesh *m_pMesh;
0038: CD3DMesh *m_pMeshBg;
0039:
0040:
0041: LPD3DXEFFECT m_pEffect;
0042: D3DXHANDLE m_hTechnique;
0043: D3DXHANDLE m_htColor;
0044: D3DXHANDLE m_htDepth;
0045: D3DXHANDLE m_hmWVP;
0046:
0047:
0048: LPDIRECT3DSURFACE9 m_pMapZ;
0049: LPDIRECT3DTEXTURE9 m_pColorTex;
0050: LPDIRECT3DSURFACE9 m_pColorSurf;
0051: LPDIRECT3DTEXTURE9 m_pDepthTex;
0052: LPDIRECT3DSURFACE9 m_pDepthSurf;
0053:
0054:
0055: D3DXMATRIX m_mWorld;
0056: D3DXMATRIX m_mView;
0057: D3DXMATRIX m_mProj;
0058:
0059: BOOL m_bLoadingApp;
0060: CD3DFont* m_pFont;
0061: UserInput m_UserInput;
0062:
0063: FLOAT m_fWorldRotX;
0064: FLOAT m_fWorldRotY;
0065: FLOAT m_fViewZoom;
0066:
0067: protected:
0068: virtual HRESULT OneTimeSceneInit();
0069: virtual HRESULT InitDeviceObjects();
0070: virtual HRESULT RestoreDeviceObjects();
0071: virtual HRESULT InvalidateDeviceObjects();
0072: virtual HRESULT DeleteDeviceObjects();
0073: virtual HRESULT Render();
0074: virtual HRESULT FrameMove();
0075: virtual HRESULT FinalCleanup();
0076: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0077:
0078: HRESULT RenderText();
0079:
0080: void UpdateInput( UserInput* pUserInput );
0081: public:
0082: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0083: CMyD3DApplication();
0084: virtual ~CMyD3DApplication();
0085: };
0086:
0087: