window now stores application pointer (remove needs for singleton)
This commit is contained in:
parent
efadea76ae
commit
c64e015ce1
|
|
@ -8,11 +8,13 @@ namespace Nz
|
||||||
{
|
{
|
||||||
using ActionCallback = std::function<void(void)>;
|
using ActionCallback = std::function<void(void)>;
|
||||||
|
|
||||||
|
class EditorBaseApplication;
|
||||||
|
|
||||||
class NAZARAEDITOR_CORE_API EditorWindow
|
class NAZARAEDITOR_CORE_API EditorWindow
|
||||||
: private Nz::ImguiHandler
|
: private Nz::ImguiHandler
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EditorWindow(const std::string& name = "");
|
EditorWindow(EditorBaseApplication* app, const std::string& name = "");
|
||||||
~EditorWindow();
|
~EditorWindow();
|
||||||
|
|
||||||
EditorWindow(const EditorWindow&) = delete;
|
EditorWindow(const EditorWindow&) = delete;
|
||||||
|
|
@ -29,6 +31,7 @@ namespace Nz
|
||||||
private:
|
private:
|
||||||
void DrawMenus();
|
void DrawMenus();
|
||||||
|
|
||||||
|
EditorBaseApplication* m_application;
|
||||||
std::string m_windowName;
|
std::string m_windowName;
|
||||||
|
|
||||||
struct MenuAction
|
struct MenuAction
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
EditorWindow::EditorWindow(const std::string& name)
|
EditorWindow::EditorWindow(EditorBaseApplication* app, const std::string& name)
|
||||||
: m_windowName(name)
|
: m_application(app)
|
||||||
|
, m_windowName(name)
|
||||||
{
|
{
|
||||||
Nz::Imgui::Instance()->AddHandler(this);
|
Nz::Imgui::Instance()->AddHandler(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue