43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
|
#include "app/Application.h"
|
||
|
|
||
|
#include "common/RecourceHelper.h"
|
||
|
#include "workspace/WorkSpaceManager.h"
|
||
|
#include "entities/EntitiesManager.h"
|
||
|
#include "viewer/OsgViewer.h"
|
||
|
#include "scene/MeshManager.h"
|
||
|
#include "network/NetDriver.h"
|
||
|
|
||
|
|
||
|
Application::Application(int& argc, char** argv, int /*= ApplicationFlags*/)
|
||
|
: QApplication(argc, argv) {
|
||
|
|
||
|
Init();
|
||
|
}
|
||
|
|
||
|
Application::~Application() {
|
||
|
Uninit();
|
||
|
}
|
||
|
|
||
|
QString Application::GetWorkSpacePath() {
|
||
|
const QString path = QString("%1/workspace").arg(applicationDirPath());
|
||
|
return path;
|
||
|
}
|
||
|
|
||
|
void Application::Init() {
|
||
|
Singleton<MeshManager>::Create(this);
|
||
|
Singleton<OsgViewer>::Create(this);
|
||
|
Singleton<RecourceHelper>::Create(this);
|
||
|
Singleton<EntitiesManager>::Create(this);
|
||
|
Singleton<WorkSpaceManager>::Create(this);
|
||
|
Singleton<NetDriver>::Create(this);
|
||
|
}
|
||
|
|
||
|
void Application::Uninit() {
|
||
|
Singleton<NetDriver>::Destory();
|
||
|
Singleton<WorkSpaceManager>::Destory();
|
||
|
Singleton<EntitiesManager>::Destory();
|
||
|
Singleton<RecourceHelper>::Destory();
|
||
|
Singleton<OsgViewer>::Destory();
|
||
|
Singleton<MeshManager>::Destory();
|
||
|
}
|