0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008: #ifdef DX9C
0009: #define BEGIN_PASS(n) m_pEffect->BeginPass(n)
0010: #define END_PASS() m_pEffect->EndPass()
0011: #else// DX9C
0012: #define BEGIN_PASS(n) m_pEffect->Pass(n)
0013: #define END_PASS()
0014: #endif
0015:
0016:
0017:
0018:
0019:
0020: #define ASCII_MAX 52
0021: #define ASCII_WIDTH 24
0022: #define ASCII_HEIGHT 24
0023:
0024:
0025: struct UserInput
0026: {
0027: BOOL bRotateUp;
0028: BOOL bRotateDown;
0029: BOOL bRotateLeft;
0030: BOOL bRotateRight;
0031: BOOL bZoomIn;
0032: BOOL bZoomOut;
0033: };
0034:
0035:
0036:
0037:
0038:
0039:
0040:
0041:
0042: class CMyD3DApplication : public CD3DApplication
0043: {
0044: CD3DMesh *m_pMesh;
0045: CD3DMesh *m_pMeshBg;
0046:
0047:
0048: LPD3DXEFFECT m_pEffect;
0049: D3DXHANDLE m_hTechnique;
0050: D3DXHANDLE m_hafWeight;
0051: D3DXHANDLE m_htSrcMap;
0052:
0053:
0054: LPDIRECT3DSURFACE9 m_pMapZ;
0055: LPDIRECT3DTEXTURE9 m_pOriginalMap;
0056: LPDIRECT3DSURFACE9 m_pOriginalMapSurf;
0057: LPDIRECT3DTEXTURE9 m_pPostMap;
0058: LPDIRECT3DSURFACE9 m_pPostMapSurf;
0059: LPDIRECT3DTEXTURE9 m_pWaveletMap[4];
0060: LPDIRECT3DTEXTURE9 m_pCoeffMap[2][4];
0061: LPDIRECT3DSURFACE9 m_pCoeffMapSurf[2][4];
0062: LPDIRECT3DTEXTURE9 m_pColorMap[2];
0063: LPDIRECT3DSURFACE9 m_pColorMapSurf[2];
0064: LPDIRECT3DTEXTURE9 m_pFinalMap;
0065: LPDIRECT3DSURFACE9 m_pFinalMapSurf;
0066: LPDIRECT3DTEXTURE9 m_pAsciiMap;
0067: LPDIRECT3DTEXTURE9 m_pAsciiCoeffMap;
0068: LPDIRECT3DTEXTURE9 m_pDiffMap[13];
0069: LPDIRECT3DSURFACE9 m_pDiffMapSurf[13];
0070: LPDIRECT3DTEXTURE9 m_pValue0Map;
0071: LPDIRECT3DTEXTURE9 m_pIndex0Map;
0072: LPDIRECT3DSURFACE9 m_pValue0MapSurf;
0073: LPDIRECT3DSURFACE9 m_pIndex0MapSurf;
0074: LPDIRECT3DTEXTURE9 m_pIndex1Map;
0075: LPDIRECT3DSURFACE9 m_pIndex1MapSurf;
0076:
0077:
0078: D3DXMATRIX m_mWorld;
0079: D3DXMATRIX m_mView;
0080: D3DXMATRIX m_mProj;
0081:
0082: BOOL m_bLoadingApp;
0083: CD3DFont* m_pFont;
0084: UserInput m_UserInput;
0085:
0086: FLOAT m_fWorldRotX;
0087: FLOAT m_fWorldRotY;
0088: FLOAT m_fViewZoom;
0089:
0090: public:
0091: unsigned char m_iTex[ASCII_MAX][ASCII_WIDTH][ASCII_HEIGHT];
0092:
0093: protected:
0094: virtual HRESULT OneTimeSceneInit();
0095: virtual HRESULT InitDeviceObjects();
0096: virtual HRESULT RestoreDeviceObjects();
0097: virtual HRESULT InvalidateDeviceObjects();
0098: virtual HRESULT DeleteDeviceObjects();
0099: virtual HRESULT Render();
0100: virtual HRESULT FrameMove();
0101: virtual HRESULT FinalCleanup();
0102: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0103:
0104: HRESULT RenderText();
0105:
0106: void UpdateInput( UserInput* pUserInput );
0107: void CreateTextureArray( LPDIRECT3DTEXTURE9 pTex );
0108:
0109: public:
0110: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0111: CMyD3DApplication();
0112: virtual ~CMyD3DApplication();
0113:
0114: };
0115:
0116: