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: BOOL bZoomIn;
0021: BOOL bZoomOut;
0022: BOOL bRoughnessUp;
0023: BOOL bRoughnessDown;
0024: };
0025:
0026:
0027:
0028:
0029:
0030:
0031:
0032:
0033: class CMyD3DApplication : public CD3DApplication
0034: {
0035: CD3DMesh *m_pMesh;
0036: LPDIRECT3DTEXTURE9 m_pTex;
0037: FLOAT m_fRoughness;
0038:
0039:
0040: LPD3DXEFFECT m_pEffect;
0041: D3DXHANDLE m_hTechnique;
0042: D3DXHANDLE m_hmWVP;
0043: D3DXHANDLE m_hvCol;
0044: D3DXHANDLE m_hvLightPos;
0045: D3DXHANDLE m_hvCamPos;
0046: D3DXHANDLE m_hfA;
0047: D3DXHANDLE m_hfB;
0048: LPDIRECT3DVERTEXDECLARATION9 m_pDecl;
0049:
0050:
0051: D3DXMATRIX m_mWorld;
0052: D3DXMATRIX m_mView;
0053: D3DXMATRIX m_mProj;
0054:
0055: D3DXVECTOR4 m_LightPos;
0056:
0057:
0058: BOOL m_bLoadingApp;
0059: CD3DFont* m_pFont;
0060: UserInput m_UserInput;
0061:
0062: FLOAT m_fWorldRotX;
0063: FLOAT m_fWorldRotY;
0064: FLOAT m_fViewZoom;
0065:
0066: protected:
0067: virtual HRESULT OneTimeSceneInit();
0068: virtual HRESULT InitDeviceObjects();
0069: virtual HRESULT RestoreDeviceObjects();
0070: virtual HRESULT InvalidateDeviceObjects();
0071: virtual HRESULT DeleteDeviceObjects();
0072: virtual HRESULT Render();
0073: virtual HRESULT FrameMove();
0074: virtual HRESULT FinalCleanup();
0075: virtual HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
0076:
0077: HRESULT RenderText();
0078:
0079: void UpdateInput( UserInput* pUserInput );
0080: public:
0081: LRESULT MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
0082: CMyD3DApplication();
0083: virtual ~CMyD3DApplication();
0084: };
0085:
0086: