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: enum {
0036: WEIGHT_MUN = 8,
0037: };
0038: FLOAT m_dispersion_sq;
0039: FLOAT m_tbl[WEIGHT_MUN];
0040: VOID UpdateWeight( FLOAT param );
0041:
0042: CD3DMesh *m_pMesh;
0043: CD3DMesh *m_pMeshBg;
0044:
0045:
0046: LPD3DXEFFECT m_pEffect;
0047: D3DXHANDLE m_hTechnique;
0048: D3DXHANDLE m_hafWeight;
0049: D3DXHANDLE m_htSrcMap;
0050: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0051:
0052:
0053: LPDIRECT3DSURFACE9 m_pMapZ;
0054: LPDIRECT3DTEXTURE9 m_pOriginalMap;
0055: LPDIRECT3DSURFACE9 m_pOriginalMapSurf;
0056: LPDIRECT3DTEXTURE9 m_pXMap;
0057: LPDIRECT3DSURFACE9 m_pXMapSurf;
0058: LPDIRECT3DTEXTURE9 m_pXYMap;
0059: LPDIRECT3DSURFACE9 m_pXYMapSurf;
0060:
0061:
0062: D3DXMATRIX m_mWorld;
0063: D3DXMATRIX m_mView;
0064: D3DXMATRIX m_mProj;
0065:
0066: BOOL m_bLoadingApp;
0067: CD3DFont* m_pFont;
0068: UserInput m_UserInput;
0069:
0070: FLOAT m_fWorldRotX;
0071: FLOAT m_fWorldRotY;
0072: FLOAT m_fViewZoom;
0073:
0074: protected:
0075: virtual HRESULT OneTimeSceneInit();
0076: virtual HRESULT InitDeviceObjects();
0077: virtual HRESULT RestoreDeviceObjects();
0078: virtual HRESULT InvalidateDeviceObjects();
0079: virtual HRESULT DeleteDeviceObjects();
0080: virtual HRESULT Render();
0081: virtual HRESULT FrameMove();
0082: virtual HRESULT FinalCleanup();
0083: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0084:
0085: HRESULT RenderText();
0086:
0087: void UpdateInput( UserInput* pUserInput );
0088: public:
0089: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0090: CMyD3DApplication();
0091: virtual ~CMyD3DApplication();
0092: };
0093:
0094: