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

80 lines
2 KiB
C++
Raw Normal View History

2015-04-30 23:15:25 +00:00
#ifndef OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
#define OPENMW_COMPONENTS_MYGUIPLATFORM_MYGUIPLATFORM_H
2015-04-24 19:55:30 +00:00
#include "MyGUI_Prerequest.h"
#include "MyGUI_LogManager.h"
#include "myguirendermanager.hpp"
#include "myguidatamanager.hpp"
#include "myguiloglistener.hpp"
2015-04-24 19:55:30 +00:00
2015-04-30 23:15:25 +00:00
namespace osgMyGUI
2015-04-24 19:55:30 +00:00
{
class Platform
{
public:
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager)
: mRenderManager(nullptr)
, mDataManager(nullptr)
, mLogManager(nullptr)
, mLogFacility(nullptr)
2015-04-24 19:55:30 +00:00
{
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;
delete mLogFacility;
mLogFacility = nullptr;
2015-04-24 19:55:30 +00:00
}
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() && !mLogFacility)
{
mLogFacility = new LogFacility(_logName, false);
mLogManager->addLogSource(mLogFacility->getSource());
}
2015-04-24 19:55:30 +00:00
mDataManager->setResourcePath(resourcePath);
mRenderManager->initialise();
mDataManager->initialise();
}
void shutdown()
{
mRenderManager->shutdown();
2015-04-24 19:55:30 +00:00
mDataManager->shutdown();
}
RenderManager* getRenderManagerPtr()
{
return mRenderManager;
}
DataManager* getDataManagerPtr()
{
return mDataManager;
}
private:
RenderManager* mRenderManager;
DataManager* mDataManager;
MyGUI::LogManager* mLogManager;
LogFacility* mLogFacility;
2015-04-24 19:55:30 +00:00
};
}
#endif