add basic editor
This commit is contained in:
9
include/NazaraEditor/Core.hpp
Normal file
9
include/NazaraEditor/Core.hpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <NazaraEditor/Core/Core.hpp>
|
||||
#include <NazaraEditor/Core/UI/Window.hpp>
|
||||
#include <NazaraEditor/Core/Reflection/Math.hpp>
|
||||
#include <NazaraEditor/Core/Reflection/Core.hpp>
|
||||
#include <NazaraEditor/Core/Reflection/Utility.hpp>
|
||||
#include <NazaraEditor/Core/Reflection/Graphics.hpp>
|
||||
#include <NazaraEditor/Core/Reflection/Editor.hpp>
|
||||
51
include/NazaraEditor/Editor/Application.hpp
Normal file
51
include/NazaraEditor/Editor/Application.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include <Nazara/Core.hpp>
|
||||
#include <Nazara/Graphics.hpp>
|
||||
#include <Nazara/Platform.hpp>
|
||||
#include <Nazara/Renderer.hpp>
|
||||
#include <Nazara/Utility.hpp>
|
||||
|
||||
#include <NazaraEditor/Core.hpp>
|
||||
#include <NazaraImgui/NazaraImgui.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class EditorApplication
|
||||
: public Nz::Application<Nz::Graphics, Nz::Imgui, Nz::EditorCore>
|
||||
{
|
||||
public:
|
||||
NazaraSignal(OnWorldChanged, Nz::EnttWorld*);
|
||||
|
||||
// Entity lifetime events
|
||||
NazaraSignal(OnEntityCreated, entt::handle);
|
||||
NazaraSignal(OnEntityDestroyed, entt::handle);
|
||||
NazaraSignal(OnEntityParentChanged, entt::handle);
|
||||
|
||||
// Entity selection events
|
||||
NazaraSignal(OnEntitySelected, entt::handle);
|
||||
NazaraSignal(OnEntityDeselected, entt::handle);
|
||||
|
||||
static EditorApplication& Instance();
|
||||
|
||||
void NewWorld();
|
||||
Nz::EnttWorld* GetCurrentWorld();
|
||||
|
||||
entt::handle CreateEntity();
|
||||
|
||||
template<typename T>
|
||||
void RegisterWindow()
|
||||
{
|
||||
static_assert(std::is_base_of<Nz::EditorWindow, T>::value, "Register Window should be called with a subclass of Nz::EditorWindow");
|
||||
m_windows.push_back(std::make_unique<T>());
|
||||
}
|
||||
|
||||
private:
|
||||
EditorApplication();
|
||||
|
||||
std::unique_ptr<Nz::WindowSwapchain> m_windowSwapchain;
|
||||
Nz::EnttWorld* m_world;
|
||||
|
||||
std::vector<std::unique_ptr<Nz::EditorWindow>> m_windows;
|
||||
};
|
||||
}
|
||||
16
include/NazaraEditor/Editor/UI/AssetsWindow.hpp
Normal file
16
include/NazaraEditor/Editor/UI/AssetsWindow.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <NazaraEditor/Core/UI/Window.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class EditorAssetsWindow
|
||||
: public Nz::EditorWindow
|
||||
{
|
||||
public:
|
||||
EditorAssetsWindow();
|
||||
|
||||
void ImportAsset();
|
||||
|
||||
protected:
|
||||
void BuildMenuBar();
|
||||
};
|
||||
}
|
||||
21
include/NazaraEditor/Editor/UI/InspectorWindow.hpp
Normal file
21
include/NazaraEditor/Editor/UI/InspectorWindow.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <NazaraEditor/Core/UI/Window.hpp>
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class EditorInspectorWindow
|
||||
: public Nz::EditorWindow
|
||||
{
|
||||
public:
|
||||
EditorInspectorWindow();
|
||||
|
||||
virtual void OnEditorGUI() override;
|
||||
|
||||
protected:
|
||||
void OnEntitySelected(entt::handle entity);
|
||||
void OnEntityDeselected(entt::handle);
|
||||
|
||||
entt::handle m_currentEntity;
|
||||
};
|
||||
}
|
||||
25
include/NazaraEditor/Editor/UI/LevelWindow.hpp
Normal file
25
include/NazaraEditor/Editor/UI/LevelWindow.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <NazaraEditor/Core/UI/Window.hpp>
|
||||
|
||||
#include <Nazara/Core.hpp>
|
||||
#include <Nazara/Utility.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class EditorLevelWindow
|
||||
: public Nz::EditorWindow
|
||||
{
|
||||
public:
|
||||
EditorLevelWindow();
|
||||
|
||||
virtual void OnEditorGUI() override;
|
||||
|
||||
protected:
|
||||
void RefreshEntities();
|
||||
|
||||
Nz::EnttWorld* m_currentWorld;
|
||||
bool m_dirty;
|
||||
|
||||
std::vector<Nz::Node*> m_rootNodes;
|
||||
std::map<Nz::Node*, entt::handle> m_nodeToEntity;
|
||||
};
|
||||
}
|
||||
24
include/NazaraEditor/Editor/UI/MainWindow.hpp
Normal file
24
include/NazaraEditor/Editor/UI/MainWindow.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <NazaraEditor/Core/UI/Window.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class EditorMainWindow
|
||||
: public Nz::EditorWindow
|
||||
{
|
||||
public:
|
||||
EditorMainWindow();
|
||||
|
||||
bool Quit();
|
||||
|
||||
bool NewLevel();
|
||||
bool OpenLevel();
|
||||
bool SaveLevel();
|
||||
|
||||
bool NewProject();
|
||||
bool OpenProject();
|
||||
bool SaveProject();
|
||||
|
||||
protected:
|
||||
void BuildMenuBar();
|
||||
};
|
||||
}
|
||||
0
include/NazaraEditor/Nouveau Text Document.txt
Normal file
0
include/NazaraEditor/Nouveau Text Document.txt
Normal file
Reference in New Issue
Block a user