0001:
0002:
0003:
0004:
0005:
0006:
0007:
0008: #pragma once
0009:
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: BOOL bPause;
0025: };
0026:
0027:
0028:
0029:
0030:
0031:
0032:
0033:
0034:
0035:
0036: class CMyD3DApplication : public CD3DApplication
0037: {
0038:
0039: LPD3DXEFFECT m_pEffect;
0040: D3DXHANDLE m_hTechnique;
0041:
0042:
0043: LPDIRECT3DSURFACE9 m_pMapZ;
0044:
0045: LPDIRECT3DTEXTURE9 m_pBackBufferTex;
0046: LPDIRECT3DSURFACE9 m_pBackBufferSurf;
0047: BOOL m_bClear;
0048: LPDIRECT3DTEXTURE9 m_pTex[5];
0049: LPDIRECT3DSURFACE9 m_pSurf[5];
0050: LPDIRECT3DTEXTURE9 m_pDotTex;
0051: LPDIRECT3DTEXTURE9 m_pTargetTex;
0052:
0053: float m_fDrop_x;
0054: float m_fDrop_y;
0055: int m_bDrop;
0056:
0057:
0058: D3DXMATRIX m_mWorld;
0059: D3DXMATRIX m_mView;
0060: D3DXMATRIX m_mProj;
0061:
0062: FLOAT m_fWorldRotX;
0063: FLOAT m_fWorldRotY;
0064: FLOAT m_fViewZoom;
0065:
0066: BOOL m_bLoadingApp;
0067: CD3DFont* m_pFont;
0068: UserInput m_UserInput;
0069:
0070: protected:
0071: virtual HRESULT OneTimeSceneInit();
0072: virtual HRESULT InitDeviceObjects();
0073: virtual HRESULT RestoreDeviceObjects();
0074: virtual HRESULT InvalidateDeviceObjects();
0075: virtual HRESULT DeleteDeviceObjects();
0076: virtual HRESULT Render();
0077: virtual HRESULT FrameMove();
0078: virtual HRESULT FinalCleanup();
0079: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0080:
0081: void SetDrop(float x , float y);
0082: void ResetDrop();
0083: int IsDrop();
0084:
0085:
0086: HRESULT RenderText();
0087:
0088: void UpdateInput( UserInput* pUserInput );
0089: public:
0090: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0091: CMyD3DApplication();
0092: virtual ~CMyD3DApplication();
0093: };
0094:
0095: