2024-11-27 22:33:09 +08:00
|
|
|
|
#include "editor/editor.h"
|
2024-12-26 11:40:41 +08:00
|
|
|
|
#include "editor/window/editor_main_window.h"
|
|
|
|
|
|
#include "os/file_manager.h"
|
2024-12-26 16:45:02 +08:00
|
|
|
|
#include "imgui.h"
|
2024-11-27 22:33:09 +08:00
|
|
|
|
namespace api {
|
|
|
|
|
|
void EditorModule::OnLoad(int argc, char** argv)
|
|
|
|
|
|
{
|
2024-12-26 11:40:41 +08:00
|
|
|
|
PackagePath editor_noesis{"/engine/assets/noesis"};
|
|
|
|
|
|
FileManager::Ptr()->Mount("editor_noesis", editor_noesis.RealPath().c_str());
|
2024-12-26 16:45:02 +08:00
|
|
|
|
IMGUI_CHECKVERSION();
|
|
|
|
|
|
ImGui::CreateContext();
|
|
|
|
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
|
|
|
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // 可选:启用键盘导航
|
|
|
|
|
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // 可选:启用Docking
|
|
|
|
|
|
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // 可选:启用多视口
|
|
|
|
|
|
ImGui::StyleColorsDark();
|
2024-11-27 22:33:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void EditorModule::OnUnload()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-12-07 18:10:01 +08:00
|
|
|
|
void EditorModule::Initialize(void)
|
|
|
|
|
|
{
|
2024-12-26 16:45:02 +08:00
|
|
|
|
EditorSystem* Editor = EditorSystem::Ptr();
|
|
|
|
|
|
Editor->AddWindow<EditorMainWindow>();
|
2024-12-07 18:10:01 +08:00
|
|
|
|
}
|
2024-11-27 22:33:09 +08:00
|
|
|
|
}
|