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