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: CD3DMesh *m_pMesh;
0036: CD3DMesh *m_pMeshBg;
0037:
0038:
0039: LPDIRECT3DSURFACE9 m_pZBg;
0040: LPDIRECT3DTEXTURE9 m_pTexBg;
0041: LPDIRECT3DSURFACE9 m_pSurfBg;
0042: LPDIRECT3DSURFACE9 m_pZObj;
0043: LPDIRECT3DTEXTURE9 m_pTexObj;
0044: LPDIRECT3DSURFACE9 m_pSurfObj;
0045:
0046:
0047: LPD3DXEFFECT m_pEffect;
0048: D3DXHANDLE m_hTechnique;
0049: D3DXHANDLE m_hmWV;
0050: D3DXHANDLE m_hmVP;
0051: D3DXHANDLE m_hmLastWV;
0052: D3DXHANDLE m_hvLightDir;
0053: D3DXHANDLE m_hvEyePos;
0054: D3DXHANDLE m_hvCol;
0055: D3DXHANDLE m_htSrcMap;
0056:
0057:
0058: D3DXMATRIX m_mWorld;
0059: D3DXMATRIX m_mView;
0060: D3DXMATRIX m_mProj;
0061: D3DXMATRIX m_mLastWV;
0062:
0063: BOOL m_bLoadingApp;
0064: CD3DFont* m_pFont;
0065: UserInput m_UserInput;
0066:
0067: FLOAT m_fWorldRotX;
0068: FLOAT m_fWorldRotY;
0069: FLOAT m_fViewZoom;
0070:
0071: protected:
0072: virtual HRESULT OneTimeSceneInit();
0073: virtual HRESULT InitDeviceObjects();
0074: virtual HRESULT RestoreDeviceObjects();
0075: virtual HRESULT InvalidateDeviceObjects();
0076: virtual HRESULT DeleteDeviceObjects();
0077: virtual HRESULT Render();
0078: virtual HRESULT FrameMove();
0079: virtual HRESULT FinalCleanup();
0080: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0081:
0082: HRESULT RenderText();
0083:
0084: void UpdateInput( UserInput* pUserInput );
0085: public:
0086: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0087: CMyD3DApplication();
0088: virtual ~CMyD3DApplication();
0089: };
0090:
0091: