0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008:
0009:
0010:
0011:
0012:
0013:
0014:
0015: #define DXAPP_KEY TEXT("Software\\DirectX AppWizard Apps\\main")
0016:
0017:
0018: struct UserInput
0019: {
0020:
0021: BOOL bRotateUp;
0022: BOOL bRotateDown;
0023: BOOL bRotateLeft;
0024: BOOL bRotateRight;
0025: BOOL bZ;
0026: BOOL bX;
0027: };
0028:
0029:
0030:
0031:
0032:
0033:
0034:
0035:
0036:
0037:
0038: class CMyD3DApplication : public CD3DApplication
0039: {
0040: BOOL m_bDMap;
0041: FLOAT m_degree;
0042: CD3DMesh *m_pMesh;
0043: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0044: LPDIRECT3DTEXTURE9 m_pDispMap;
0045: LPD3DXEFFECT m_pEffect;
0046:
0047: D3DXMATRIX m_mWorld;
0048: D3DXMATRIX m_mView;
0049: D3DXMATRIX m_mProj;
0050: D3DXVECTOR4 m_LighPos;
0051:
0052: BOOL m_bLoadingApp;
0053: CD3DFont* m_pFont;
0054: UserInput m_UserInput;
0055:
0056: FLOAT m_fWorldRotX;
0057: FLOAT m_fWorldRotY;
0058:
0059: protected:
0060: virtual HRESULT OneTimeSceneInit();
0061: virtual HRESULT InitDeviceObjects();
0062: virtual HRESULT RestoreDeviceObjects();
0063: virtual HRESULT InvalidateDeviceObjects();
0064: virtual HRESULT DeleteDeviceObjects();
0065: virtual HRESULT Render();
0066: virtual HRESULT FrameMove();
0067: virtual HRESULT FinalCleanup();
0068: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0069:
0070: HRESULT RenderText();
0071:
0072: void UpdateInput( UserInput* pUserInput );
0073: public:
0074: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0075: CMyD3DApplication();
0076: virtual ~CMyD3DApplication();
0077: };
0078:
0079: