1. #ifndef _IRRLICHTENGINEMANAGER_H__
  2. #define _IRRLICHTENGINEMANAGER_H__
  3.  
  4. #include <irrlicht.h>
  5.  
  6. /**
  7. A handy macro that allows us to access the IrrlichtEngineManager singelton instance
  8. */
  9. #define ENGINEMANAGER IrrlichtEngineManager::Instance()
  10.  
  11. using namespace irr;
  12. using namespace core;
  13. using namespace scene;
  14. using namespace video;
  15. using namespace io;
  16. using namespace gui;
  17.  
  18. /**
  19. IrrlichtEngineManager is used to manage the Irrlicht 3D engine
  20. */
  21. class IrrlichtEngineManager
  22. {
  23. public:
  24. /**
  25. Standard destructor
  26. */
  27. ~IrrlichtEngineManager();
  28. /**
  29. Returns a reference to the singelton object
  30. */
  31. static IrrlichtEngineManager& Instance()
  32. {
  33. static IrrlichtEngineManager instance;
  34. return instance;
  35. }
  36. /**
  37. Initialises the resources needed for the Irrlicht3D engine
  38. */
  39. void Startup();
  40. /**
  41. Cleans up the Irrlicht3D engine resources
  42. */
  43. void Shutdown();
  44. /**
  45. Enters the render loop
  46. */
  47. void StartRenderLoop();
  48. /**
  49. Stops the render loop
  50. */
  51. void EndRenderLoop();
  52.  
  53. protected:
  54. /**
  55. Standard constructor
  56. */
  57. IrrlichtEngineManager();
  58. /**
  59. Sets all the member variables to NULL. This is called both by the constructor
  60. and the Shutdown function.
  61. */
  62. void InitialiseVariables();
  63. /// The Irrlicht3D Device
  64. IrrlichtDevice *device;
  65. /// The Irrlicht3D Video Driver
  66. IVideoDriver* driver;
  67. /// The Irrlicht3D Scene Manager
  68. ISceneManager* smgr;
  69. };
  70.  
  71. #endif