- #include "IrrlichtEngineManager.h"
- #include "ConfigurationValues.h"
-
- IrrlichtEngineManager::IrrlichtEngineManager()
- {
- InitialiseVariables();
- }
-
- IrrlichtEngineManager::~IrrlichtEngineManager()
- {
-
- }
-
- void IrrlichtEngineManager::InitialiseVariables()
- {
- device = NULL;
- driver = NULL;
- smgr = NULL;
- }
-
- void IrrlichtEngineManager::Startup()
- {
- device = createDevice(VIDEO_RENDERER, dimension2d<u32>(SCREEN_WIDTH, SCREEN_HEIGHT));
- // Set the window title
- device->setWindowCaption(L"Irrlicht Tutorial");
- // get pointers to the video driver and the scene manager for convenience
- driver = device->getVideoDriver();
- smgr = device->getSceneManager();
- }
-
- void IrrlichtEngineManager::Shutdown()
- {
- // any object that was created with a function that starts with "create" needs to be
- // deleted with a call to drop
- device->drop();
- // reset our other variables for consistency
- InitialiseVariables();
- }
-
- void IrrlichtEngineManager::StartRenderLoop()
- {
- while(device->run())
- {
- /*
- The render loop. Begin the scene, draw the various elements, and then end the scene
- */
- driver->beginScene(true, true, SColor(SCREEN_CLEAR_COLOUR));
-
- smgr->drawAll();
-
- driver->endScene();
- }
- }
-
- void IrrlichtEngineManager::EndRenderLoop()
- {
- // make device->Run() return false
- device->closeDevice();
- }