mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-11-04 12:51:48 +00:00
Almost entirely moved ImGui dependency (and settings) from Engine to Editor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user