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:
0023: BOOL sw;
0024: };
0025:
0026:
0027:
0028:
0029:
0030:
0031:
0032:
0033: class CMyD3DApplication : public CD3DApplication
0034: {
0035: enum{
0036: Parallax = 0,
0037: Bump,
0038: SHADER_TYPE_MAX,
0039: };
0040:
0041: int m_iShader;
0042:
0043: LPDIRECT3DTEXTURE9 m_pHeightMap;
0044: LPDIRECT3DTEXTURE9 m_pNormalMap;
0045: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0046: CD3DMesh *m_pMesh;
0047: CD3DMesh *m_pMeshBg;
0048:
0049:
0050: LPD3DXEFFECT m_pEffect;
0051: D3DXHANDLE m_hTechnique;
0052: D3DXHANDLE m_hmWVP;
0053: D3DXHANDLE m_hvLightDir;
0054: D3DXHANDLE m_hvColor;
0055: D3DXHANDLE m_hvEyePos;
0056: D3DXHANDLE m_htDecaleTex;
0057: D3DXHANDLE m_htHeightMap;
0058: D3DXHANDLE m_htNormalMap;
0059:
0060:
0061:
0062: D3DXVECTOR4 m_vFromPt;
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: