0001:
0002:
0003:
0004:
0005:
0006: #pragma once
0007:
0008:
0009:
0010:
0011:
0012:
0013:
0014:
0015:
0016: struct UserInput
0017: {
0018: BOOL bRotateUp;
0019: BOOL bRotateDown;
0020: BOOL bRotateLeft;
0021: BOOL bRotateRight;
0022: BOOL bZoomIn;
0023: BOOL bZoomOut;
0024:
0025: BOOL bShift;
0026:
0027: BOOL b1;
0028: BOOL b2;
0029: };
0030:
0031:
0032:
0033:
0034:
0035:
0036:
0037:
0038: class CMyD3DApplication : public CD3DApplication
0039: {
0040: enum{
0041: BRDF_Garnet_Red= 0,
0042: BRDF_Krylon_Latex_Enamel,
0043: BRDF_Cayman_Blue_Lacquer,
0044: BRDF_Mystique_Lacquer,
0045: BRDF_Velvet,
0046: BRDF_Leather,
0047: BRDF_Satin,
0048: BRDF_MAX,
0049: };
0050: static char BRDF_name[BRDF_MAX][256];
0051: static char BRDF_file[BRDF_MAX][2][256];
0052: static float BRDF_color[BRDF_MAX][4];
0053:
0054: LPDIRECT3DTEXTURE9 m_pTex[BRDF_MAX][2];
0055: int m_nBrdf;
0056:
0057: LPD3DXEFFECT m_pEffect;
0058: ID3DXMesh* m_pD3DXMesh;
0059: LPDIRECT3DTEXTURE9 m_pEnvMap;
0060:
0061: BOOL m_bLoadingApp;
0062: CD3DFont* m_pFont;
0063: UserInput m_UserInput;
0064:
0065: FLOAT m_fWorldRotX;
0066: FLOAT m_fWorldRotY;
0067: FLOAT m_fViewZoom;
0068:
0069: FLOAT m_fLightRotX;
0070: FLOAT m_fLightRotY;
0071:
0072: D3DXMATRIX m_mW;
0073: D3DXMATRIX m_mV;
0074: D3DXMATRIX m_mP;
0075:
0076: D3DXMATRIX m_mLight;
0077:
0078: protected:
0079: virtual HRESULT OneTimeSceneInit();
0080: virtual HRESULT InitDeviceObjects();
0081: virtual HRESULT RestoreDeviceObjects();
0082: virtual HRESULT InvalidateDeviceObjects();
0083: virtual HRESULT DeleteDeviceObjects();
0084: virtual HRESULT Render();
0085: virtual HRESULT FrameMove();
0086: virtual HRESULT FinalCleanup();
0087: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0088:
0089: HRESULT RenderText();
0090:
0091: void UpdateInput( UserInput* pUserInput );
0092:
0093: public:
0094: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0095: CMyD3DApplication();
0096: virtual ~CMyD3DApplication();
0097: };
0098:
0099: