1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:49:55 +00:00
openmw-tes3mp/apps/openmw/mwgui/myguiplatform.hpp

72 lines
1.7 KiB
C++
Raw Normal View History

2015-04-24 19:55:30 +00:00
#ifndef OPENMW_MWGUI_MYGUIPLATFORM_H
#define OPENMW_MWGUI_MYGUIPLATFORM_H
#include "MyGUI_Prerequest.h"
#include "MyGUI_LogManager.h"
#include "myguirendermanager.hpp"
#include "myguidatamanager.hpp"
namespace MWGui
{
class Platform
{
public:
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager) :
mLogManager(nullptr),
mRenderManager(nullptr),
mDataManager(nullptr)
{
mLogManager = new MyGUI::LogManager();
mRenderManager = new RenderManager(viewer, guiRoot, textureManager);
mDataManager = new DataManager();
}
~Platform()
{
delete mRenderManager;
mRenderManager = nullptr;
delete mDataManager;
mDataManager = nullptr;
delete mLogManager;
mLogManager = nullptr;
}
2015-04-28 14:02:29 +00:00
void initialise(const std::string& resourcePath, const std::string& _logName = "MyGUI.log")
2015-04-24 19:55:30 +00:00
{
if (!_logName.empty())
MyGUI::LogManager::getInstance().createDefaultSource(_logName);
mDataManager->setResourcePath(resourcePath);
mRenderManager->initialise();
mDataManager->initialise();
}
void shutdown()
{
//mRenderManager->shutdown();
mDataManager->shutdown();
}
RenderManager* getRenderManagerPtr()
{
return mRenderManager;
}
DataManager* getDataManagerPtr()
{
return mDataManager;
}
private:
RenderManager* mRenderManager;
DataManager* mDataManager;
MyGUI::LogManager* mLogManager;
};
}
#endif