1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/components/myguiplatform/myguiplatform.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.3 KiB
C++
Raw Normal View History

2015-04-24 19:55:30 +00:00
#include "myguiplatform.hpp"
#include "myguidatamanager.hpp"
#include "myguiloglistener.hpp"
#include "myguirendermanager.hpp"
#include "components/files/conversion.hpp"
namespace osgMyGUI
{
Platform::Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::ImageManager* imageManager,
const VFS::Manager* vfs, float uiScalingFactor, const std::filesystem::path& resourcePath,
const std::filesystem::path& logName)
: mLogFacility(logName.empty() ? nullptr : std::make_unique<LogFacility>(logName, false))
, mLogManager(std::make_unique<MyGUI::LogManager>())
, mDataManager(std::make_unique<DataManager>(Files::pathToUnicodeString(resourcePath), vfs))
, mRenderManager(std::make_unique<RenderManager>(viewer, guiRoot, imageManager, uiScalingFactor))
{
if (mLogFacility != nullptr)
mLogManager->addLogSource(mLogFacility->getSource());
2022-09-22 18:26:05 +00:00
mRenderManager->initialise();
}
2022-09-22 18:26:05 +00:00
Platform::~Platform() = default;
2022-09-22 18:26:05 +00:00
void Platform::shutdown()
{
mRenderManager->shutdown();
}
2022-09-22 18:26:05 +00:00
RenderManager* Platform::getRenderManagerPtr()
{
return mRenderManager.get();
}
2022-09-22 18:26:05 +00:00
DataManager* Platform::getDataManagerPtr()
{
return mDataManager.get();
}
}