0001:
0002:
0003:
0004:
0005:
0006:
0007: #pragma once
0008:
0009: #define REDUCTION_MAPS 3
0010:
0011:
0012:
0013:
0014:
0015: struct UserInput
0016: {
0017: BOOL bRotateUp;
0018: BOOL bRotateDown;
0019: BOOL bRotateLeft;
0020: BOOL bRotateRight;
0021: BOOL bZoomIn;
0022: BOOL bZoomOut;
0023: BOOL bChangeShader;
0024:
0025: BOOL bUp;
0026: BOOL bDown;
0027: BOOL bLeft;
0028: BOOL bRight;
0029: };
0030:
0031:
0032:
0033:
0034:
0035:
0036:
0037:
0038: class CMyD3DApplication : public CD3DApplication
0039: {
0040: enum{
0041: L_MAX = 1,
0042: TEX_MAX = ((L_MAX+1)*(L_MAX+1)+3)/4,
0043: };
0044:
0045: int m_Shader;
0046:
0047: CD3DMesh *m_pMesh;
0048: CD3DMesh *m_pMeshBg;
0049: CD3DMesh *m_pMeshEnv;
0050:
0051: D3DXVECTOR3 m_pos;
0052: D3DXVECTOR3 m_vel;
0053:
0054:
0055: LPD3DXEFFECT m_pEffect;
0056: D3DXHANDLE m_hTechnique;
0057: D3DXHANDLE m_hmWVP;
0058: D3DXHANDLE m_htSrcTex;
0059:
0060:
0061: LPD3DXEFFECT m_pEffectHDR;
0062: D3DXHANDLE m_hTechniqueHDR;
0063: D3DXHANDLE m_hmWVP_HDR;
0064: D3DXHANDLE m_htTextureHDR;
0065: LPDIRECT3DTEXTURE9 m_pEnvMap;
0066:
0067:
0068: LPDIRECT3DSURFACE9 m_pMapZ;
0069: LPDIRECT3DTEXTURE9 m_pParaboloidTex[2];
0070: LPDIRECT3DSURFACE9 m_pParaboloidSurf[2];
0071: LPDIRECT3DTEXTURE9 m_pJacobianTex[1][2];
0072:
0073: LPDIRECT3DTEXTURE9 m_pReductionTex [REDUCTION_MAPS];
0074: LPDIRECT3DSURFACE9 m_pReductionSurf[REDUCTION_MAPS];
0075:
0076: LPDIRECT3DTEXTURE9 m_pMaxNLTex[1];
0077:
0078:
0079:
0080: D3DXMATRIX m_mWorld;
0081: D3DXMATRIX m_mView;
0082: D3DXMATRIX m_mProj;
0083:
0084: BOOL m_bLoadingApp;
0085: CD3DFont* m_pFont;
0086: UserInput m_UserInput;
0087:
0088: FLOAT m_fWorldRotX;
0089: FLOAT m_fWorldRotY;
0090: FLOAT m_fViewZoom;
0091:
0092: protected:
0093: virtual HRESULT OneTimeSceneInit();
0094: virtual HRESULT InitDeviceObjects();
0095: virtual HRESULT RestoreDeviceObjects();
0096: virtual HRESULT InvalidateDeviceObjects();
0097: virtual HRESULT DeleteDeviceObjects();
0098: virtual HRESULT Render();
0099: virtual HRESULT FrameMove();
0100: virtual HRESULT FinalCleanup();
0101: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0102:
0103: virtual void RenderParaboloidMap();
0104:
0105: HRESULT RenderText();
0106:
0107: void UpdateInput( UserInput* pUserInput );
0108: public:
0109: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0110: CMyD3DApplication();
0111: virtual ~CMyD3DApplication();
0112: };
0113:
0114: