Game.h
上传用户:whgydz
上传日期:2007-01-12
资源大小:2259k
文件大小:1k
源码类别:

其他书籍

开发平台:

HTML/CSS

  1. // Game.h: interface for the CGame class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_GAME_H__687221F3_ACFF_4D66_97DB_88AB70E0CA59__INCLUDED_)
  5. #define AFX_GAME_H__687221F3_ACFF_4D66_97DB_88AB70E0CA59__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include <d3dx8.h>
  10. #include <stdio.h>
  11. #include "Helper.h"
  12. #include "Cuboid.h"
  13. class CGame  
  14. {
  15. public:
  16. void EnableLogging();
  17. bool Initialise(HWND hWnd, UINT nWidth, UINT nHeight);
  18. void GameLoop();
  19. LPDIRECT3DDEVICE8 GetDevice();
  20. CGame();
  21. virtual ~CGame();
  22. private:
  23. bool m_fEnableLogging;
  24. D3DFORMAT CheckDisplayMode(UINT nWidth, UINT nHeight, UINT nDepth);
  25. bool InitialiseGame();
  26. HRESULT InitialiseD3D(HWND hWnd, UINT nWidth, UINT nHeight);
  27. void Render();
  28. LPDIRECT3D8 m_pD3D;
  29. LPDIRECT3DDEVICE8 m_pD3DDevice;
  30. void SetupRotation();
  31. void SetupCamera();
  32. void SetupPerspective();
  33. void WriteToLog(char *lpszText, ...);
  34. DWORD m_dwFrames;
  35. DWORD m_dwStartTime;
  36. DWORD m_dwEndTime;
  37. CCuboid* m_pCube1;
  38. CCuboid* m_pCube2;
  39. CCuboid* m_pCube3;
  40. CCuboid* m_pCube4;
  41. CCuboid* m_pCube5;
  42. CCuboid* m_pCube6;
  43. };
  44. #endif // !defined(AFX_GAME_H__687221F3_ACFF_4D66_97DB_88AB70E0CA59__INCLUDED_)