0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008:
0009:
0010:
0011:
0012:
0013:
0014:
0015: struct UserInput
0016: {
0017: BOOL bRotateUp;
0018: BOOL bRotateDown;
0019: BOOL bRotateLeft;
0020: BOOL bRotateRight;
0021: BOOL bZ;
0022: BOOL bX;
0023: };
0024:
0025:
0026:
0027:
0028:
0029:
0030: class CMyD3DApplication : public CD3DApplication
0031: {
0032: CD3DMesh* m_pMeshBG;
0033:
0034:
0035: LPDIRECT3DSURFACE9 m_pMapZ;
0036: LPDIRECT3DTEXTURE9 m_pSubLightMap[2];
0037: LPDIRECT3DSURFACE9 m_pSubLightMapSurf[2];
0038: LPDIRECT3DTEXTURE9 m_pIrradianceMap;
0039: LPDIRECT3DSURFACE9 m_pIrradianceMapSurf;
0040: LPDIRECT3DTEXTURE9 m_pPosMap;
0041: LPDIRECT3DSURFACE9 m_pPosMapSurf;
0042: LPDIRECT3DTEXTURE9 m_pDistMap;
0043: LPDIRECT3DSURFACE9 m_pDistMapSurf;
0044: BOOL m_bDistMap;
0045:
0046: LPD3DXEFFECT m_pEffect;
0047: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0048: D3DXHANDLE m_hTechPos;
0049: D3DXHANDLE m_hTechDist;
0050: D3DXHANDLE m_hTechIrradiance;
0051: D3DXHANDLE m_hTechSubLight;
0052: D3DXHANDLE m_hTechFinal;
0053: D3DXHANDLE m_hmWVP;
0054: D3DXHANDLE m_hvDir;
0055: D3DXHANDLE m_htDecale;
0056: D3DXHANDLE m_htIrradiance;
0057: D3DXHANDLE m_htSubLight;
0058:
0059: D3DXMATRIX m_mWorld;
0060: D3DXMATRIX m_mCamera;
0061: D3DXMATRIX m_mView;
0062: D3DXMATRIX m_mProj;
0063:
0064: FLOAT m_zoom;
0065: FLOAT m_fWorldRotX;
0066: FLOAT m_fWorldRotY;
0067: D3DXVECTOR3 m_LightDir;
0068:
0069: BOOL m_bLoadingApp;
0070: CD3DFont* m_pFont;
0071: UserInput m_UserInput;
0072:
0073: protected:
0074: virtual HRESULT OneTimeSceneInit();
0075: virtual HRESULT InitDeviceObjects();
0076: virtual HRESULT RestoreDeviceObjects();
0077: virtual HRESULT InvalidateDeviceObjects();
0078: virtual HRESULT DeleteDeviceObjects();
0079: virtual HRESULT Render();
0080: virtual HRESULT FrameMove();
0081: virtual HRESULT FinalCleanup();
0082: virtual HRESULT ConfirmDevice(D3DCAPS9*, DWORD, D3DFORMAT);
0083:
0084: HRESULT RenderText();
0085:
0086: void UpdateInput( UserInput* pUserInput );
0087: public:
0088: LRESULT MsgProc( HWND hWnd, UINT msg
0089: , WPARAM wParam, LPARAM lParam );
0090: CMyD3DApplication();
0091: virtual ~CMyD3DApplication();
0092: };
0093: