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