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: };
0021:
0022:
0023:
0024:
0025:
0026:
0027:
0028:
0029: class CMyD3DApplication : public CD3DApplication
0030: {
0031: enum{
0032: STATE_INIT=0,
0033: STATE_SORT,
0034: };
0035:
0036: LPDIRECT3DTEXTURE9 m_pSeedTex;
0037:
0038: int m_id;
0039: LPDIRECT3DTEXTURE9 m_pSortTex[2];
0040: LPDIRECT3DSURFACE9 m_pSortSurf[2];
0041:
0042:
0043: LPD3DXEFFECT m_pEffect;
0044: D3DXHANDLE m_hTechnique;
0045: D3DXHANDLE m_htSrcMap;
0046: D3DXHANDLE m_hstage;
0047: D3DXHANDLE m_hstepno;
0048: D3DXHANDLE m_hoffset;
0049:
0050: BOOL m_bLoadingApp;
0051: BOOL m_bDispText;
0052: CD3DFont* m_pFont;
0053: UserInput m_UserInput;
0054:
0055: int m_iState;
0056: int m_cnt;
0057: inline VOID SetState(int val){m_iState=val;m_cnt=-1;}
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: virtual int RenderStateSort();
0071:
0072: HRESULT RenderText();
0073:
0074: BOOL Sort();
0075:
0076: void UpdateInput( UserInput* pUserInput );
0077: public:
0078: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0079: CMyD3DApplication();
0080: virtual ~CMyD3DApplication();
0081: };
0082:
0083: