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