Almost entirely moved ImGui dependency (and settings) from Engine to Editor

This commit is contained in:
Simon Lübeß
2026-08-09 16:49:54 +02:00
parent faa3040471
commit f8e533f28d
19 changed files with 98 additions and 55 deletions
+15 -18
View File
@@ -1,6 +1,5 @@
using System;
using GlitchyEngine.Events;
using GlitchyEngine.ImGui;
using GlitchyEngine.Renderer;
using GlitchyEngine.Debug;
using GlitchyEngine.Content;
@@ -22,9 +21,6 @@ namespace GlitchyEngine
private append LayerStack _layerStack = .();
#if IMGUI
private ImGuiLayer _imGuiLayer;
#endif
private append GameTime _gameTime = .();
@@ -47,8 +43,6 @@ namespace GlitchyEngine
public static Application Instance => s_Instance;
public Settings Settings {get; private set;} = new .() ~ delete _;
public this()
{
Profiler.ProfileFunction!();
@@ -77,17 +71,6 @@ namespace GlitchyEngine
Renderer.Init();
ScriptEngine.Init();
#if IMGUI
_imGuiLayer = new ImGuiLayer();
PushOverlay(_imGuiLayer);
#endif
GlitchyEngine.Settings.Load();
Settings.OnApplySettings.Add(new (s, e) => {
OnEvent(scope SettingsAppliedEvent());
});
Settings.Apply();
}
/// Initializes the content manager.
@@ -184,7 +167,7 @@ namespace GlitchyEngine
if(allowFrame)
{
#if IMGUI
_imGuiLayer.ImGuiRender();
//_imGuiLayer.ImGuiRender();
#endif
_window.Context.SwapChain.Present();
@@ -214,6 +197,20 @@ namespace GlitchyEngine
ownOverlay.OnAttach();
}
public void PopLayer(Layer layer)
{
Profiler.ProfileFunction!();
_layerStack.PopLayer(layer);
}
public void PopOverlay(Layer layer)
{
Profiler.ProfileFunction!();
_layerStack.PopOverlay(layer);
}
public bool OnWindowClose(WindowCloseEvent e)
{
_running = false;