re-adding editorbaseapplication singleton
This commit is contained in:
parent
2cef656ead
commit
8dd179e784
|
|
@ -33,7 +33,9 @@ namespace Nz
|
|||
// Editor events
|
||||
NazaraSignal(OnActionRegistered, const EditorAction::Properties&);
|
||||
EditorBaseApplication();
|
||||
virtual ~EditorBaseApplication() = default;
|
||||
virtual ~EditorBaseApplication();
|
||||
|
||||
static EditorBaseApplication* Instance();
|
||||
|
||||
void SetResourceFolder(const std::filesystem::path& path) { m_resourceFolder = path; }
|
||||
std::filesystem::path GetResourceFolder() const { return m_resourceFolder; }
|
||||
|
|
@ -60,6 +62,7 @@ namespace Nz
|
|||
}
|
||||
|
||||
private:
|
||||
static EditorBaseApplication* s_instance;
|
||||
std::unique_ptr<Nz::WindowSwapchain> m_windowSwapchain;
|
||||
std::vector<std::unique_ptr<Nz::EditorWindow>> m_windows;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,14 @@
|
|||
|
||||
namespace Nz
|
||||
{
|
||||
EditorBaseApplication* EditorBaseApplication::s_instance = nullptr;
|
||||
|
||||
EditorBaseApplication::EditorBaseApplication()
|
||||
: m_level(this)
|
||||
{
|
||||
NazaraAssert(s_instance == nullptr, "EditorBaseApplication already exists");
|
||||
s_instance = this;
|
||||
|
||||
auto& windowing = AddComponent<Nz::AppWindowingComponent>();
|
||||
|
||||
std::shared_ptr<Nz::RenderDevice> device = Nz::Graphics::Instance()->GetRenderDevice();
|
||||
|
|
@ -43,6 +48,16 @@ namespace Nz
|
|||
});
|
||||
}
|
||||
|
||||
EditorBaseApplication::~EditorBaseApplication()
|
||||
{
|
||||
s_instance = nullptr;
|
||||
}
|
||||
|
||||
EditorBaseApplication* EditorBaseApplication::Instance()
|
||||
{
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
Nz::Level& EditorBaseApplication::GetLevel()
|
||||
{
|
||||
return m_level;
|
||||
|
|
|
|||
Loading…
Reference in New Issue