From f8e533f28d9292b54f5337d30b2c66ffa31a1f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 9 Aug 2026 16:49:54 +0200 Subject: [PATCH] Almost entirely moved ImGui dependency (and settings) from Engine to Editor --- GlitchyEditor/BeefProj.toml | 9 ++++- .../src/CodeEditors/RiderIdeAdapter.bf | 6 ++-- .../src/CodeEditors/VisualStudioIdeAdapter.bf | 4 +-- .../src/EditWindows/ContentBrowserWindow.bf | 2 +- GlitchyEditor/src/EditorApp.bf | 29 +++++++++++++++- GlitchyEditor/src/EditorLayer.bf | 23 +++++++------ GlitchyEditor/src/EditorSettings.bf | 2 +- .../src/ImGui/ImGuiExtension.bf | 0 .../src/ImGui/ImGuiLayer.bf | 12 +++++-- .../src/ImGui/ImGuiRenderEvent.bf | 2 +- .../src/Platform/DX11/ImGui/Dx11ImGui.bf | 0 GlitchyEditor/src/Project.bf | 2 +- .../src/Settings.bf | 9 ++--- GlitchyEditor/src/SettingsWindow.bf | 2 +- GlitchyEngine/BeefProj.toml | 9 ++--- GlitchyEngine/src/Application.bf | 33 +++++++++---------- GlitchyEngine/src/Input.bf | 4 +-- GlitchyEngine/src/LayerStack.bf | 2 ++ .../src/Platform/Windows/WindowsWindow.bf | 3 ++ 19 files changed, 98 insertions(+), 55 deletions(-) rename {GlitchyEngine => GlitchyEditor}/src/ImGui/ImGuiExtension.bf (100%) rename {GlitchyEngine => GlitchyEditor}/src/ImGui/ImGuiLayer.bf (98%) rename {GlitchyEngine => GlitchyEditor}/src/ImGui/ImGuiRenderEvent.bf (92%) rename {GlitchyEngine => GlitchyEditor}/src/Platform/DX11/ImGui/Dx11ImGui.bf (100%) rename {GlitchyEngine => GlitchyEditor}/src/Settings.bf (93%) diff --git a/GlitchyEditor/BeefProj.toml b/GlitchyEditor/BeefProj.toml index f8f6ccc..c38f775 100644 --- a/GlitchyEditor/BeefProj.toml +++ b/GlitchyEditor/BeefProj.toml @@ -4,13 +4,16 @@ FileVersion = 1 Name = "GlitchyEditor" TargetType = "BeefGUIApplication" StartupObject = "GlitchyEngine.Program" -ProcessorMacros = ["GE_EDITOR_IMGUI_DEMO"] +ProcessorMacros = ["GE_EDITOR_IMGUI_DEMO", "GE_GRAPHICS_DX11"] [Dependencies] corlib = "*" GlitchLog = "*" GlitchyEngine = "*" Xml-Beef = "*" +ImGuiImplDX11 = "*" +ImGuiImplWin32 = "*" +ImGuizmo = "*" [Platform.Windows] IconFile = "$(ProjectDir)/Resources/Textures/GlitchyEngineIcon.ico" @@ -18,9 +21,13 @@ IconFile = "$(ProjectDir)/Resources/Textures/GlitchyEngineIcon.ico" [Configs.Debug.Win64] PostBuildCmds = ["CopyFilesIfNewer(\"$(WorkspaceDir)/bin/vswhere.exe\", \"$(TargetDir)\")"] DebugCommandArguments = "\"D:\\Development\\Git\\SingleStateToOrbit\"" +PreprocessorMacros = ["DEBUG", "IMGUI"] [Configs.Release.Win64] +TargetDirectory = "$(BuildDir)/dist" PostBuildCmds = ["CopyFilesIfNewer(\"$(WorkspaceDir)/bin/vswhere.exe\", \"$(TargetDir)\")"] +DebugCommandArguments = "\"D:\\Development\\Git\\SingleStateToOrbit\"" +PreprocessorMacros = ["RELEASE", "IMGUI"] [Configs.Paranoid.Win64] PostBuildCmds = ["CopyFilesIfNewer(\"$(WorkspaceDir)/bin/vswhere.exe\", \"$(TargetDir)\")"] diff --git a/GlitchyEditor/src/CodeEditors/RiderIdeAdapter.bf b/GlitchyEditor/src/CodeEditors/RiderIdeAdapter.bf index 1da2ae7..fde52e8 100644 --- a/GlitchyEditor/src/CodeEditors/RiderIdeAdapter.bf +++ b/GlitchyEditor/src/CodeEditors/RiderIdeAdapter.bf @@ -22,7 +22,7 @@ class RiderIdeAdapter : IIdeAdapter Editor.Instance.CurrentProject.GetPathToScriptSolutionFile(solutionPath); ProcessStartInfo startInfo = scope .(); - startInfo.SetFileName(Application.Instance.Settings.ScriptSettings.RiderPath); + startInfo.SetFileName(EditorApp.Instance.Settings.ScriptSettings.RiderPath); startInfo.SetArguments(scope $"{solutionPath} --line {lineNumber} {fileName}"); scope SpawnedProcess().Start(startInfo); @@ -39,7 +39,7 @@ class RiderIdeAdapter : IIdeAdapter return; } - if (!File.Exists(Application.Instance.Settings.ScriptSettings.RiderPath)) + if (!File.Exists(EditorApp.Instance.Settings.ScriptSettings.RiderPath)) { Editor.Instance.ShowSettings(); Editor.Instance.SettingsWindow.HighlightSetting("Tools", "Rider path"); @@ -51,7 +51,7 @@ class RiderIdeAdapter : IIdeAdapter } ProcessStartInfo startInfo = scope .(); - startInfo.SetFileName(Application.Instance.Settings.ScriptSettings.RiderPath); + startInfo.SetFileName(EditorApp.Instance.Settings.ScriptSettings.RiderPath); startInfo.SetArguments(solutionPath); scope SpawnedProcess().Start(startInfo); diff --git a/GlitchyEditor/src/CodeEditors/VisualStudioIdeAdapter.bf b/GlitchyEditor/src/CodeEditors/VisualStudioIdeAdapter.bf index 81ccadd..fff684a 100644 --- a/GlitchyEditor/src/CodeEditors/VisualStudioIdeAdapter.bf +++ b/GlitchyEditor/src/CodeEditors/VisualStudioIdeAdapter.bf @@ -31,7 +31,7 @@ class VisualStudioIdeAdapter : IIdeAdapter if (IsRunning()) { ProcessStartInfo startInfo = scope .(); - startInfo.SetFileName(Application.Instance.Settings.ScriptSettings.VisualStudioPath); + startInfo.SetFileName(EditorApp.Instance.Settings.ScriptSettings.VisualStudioPath); startInfo.SetArguments(scope $"/Edit {fileName}"); scope SpawnedProcess().Start(startInfo); @@ -39,7 +39,7 @@ class VisualStudioIdeAdapter : IIdeAdapter else { ProcessStartInfo startInfo = scope .(); - startInfo.SetFileName(Application.Instance.Settings.ScriptSettings.VisualStudioPath); + startInfo.SetFileName(EditorApp.Instance.Settings.ScriptSettings.VisualStudioPath); startInfo.SetArguments(scope $"/Edit {fileName}"); scope SpawnedProcess().Start(startInfo); diff --git a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf index 76a18e3..33deb62 100644 --- a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf +++ b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf @@ -604,7 +604,7 @@ namespace GlitchyEditor.EditWindows if (ImGui.MenuItem("Open C# Project...")) { - switch (Application.Instance.Settings.ScriptSettings.SelectedIde) + switch (EditorApp.Instance.Settings.ScriptSettings.SelectedIde) { case .VisualStudio: VisualStudioIdeAdapter.OpenScriptProject(); diff --git a/GlitchyEditor/src/EditorApp.bf b/GlitchyEditor/src/EditorApp.bf index de9a70a..57b1a94 100644 --- a/GlitchyEditor/src/EditorApp.bf +++ b/GlitchyEditor/src/EditorApp.bf @@ -11,6 +11,8 @@ using GlitchyEditor.Multithreading; using System.Threading; using GlitchyEditor.Platform; using System.Diagnostics; +using GlitchyEditor.ImGui; +using GlitchyEngine.Events; namespace GlitchyEditor { @@ -23,6 +25,14 @@ namespace GlitchyEditor private append BackgroundTaskManager _backgroundTaskManager = .(); public BackgroundTaskManager BackgroundTaskManager => _backgroundTaskManager; + +#if IMGUI + private ImGuiLayer _imGuiLayer; +#endif + + private EditorLayer _editorLayer; + + public Settings Settings { get; private set; } = new .() ~ delete _; public this(String[] args) { @@ -38,11 +48,28 @@ namespace GlitchyEditor DragDropManager.Init(); - PushLayer(new EditorLayer(args, _contentManager)); +#if IMGUI + _imGuiLayer = new ImGuiLayer(); + PushOverlay(_imGuiLayer); +#endif + + _editorLayer = new EditorLayer(args, _contentManager); + PushLayer(_editorLayer); + + GlitchyEditor.Settings.Load(); + Settings.OnApplySettings.Add(new (s, e) => { + OnEvent(scope SettingsAppliedEvent()); + }); + Settings.Apply(); } public ~this() { + // TODO: We should clear the queue of _backgroundTaskManager + // TODO: We should maybe also notify the user that that would happen! + + PopLayer(_editorLayer); + DragDropManager.Deinit(); _backgroundTaskManager.Deinit(); diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index 19073ce..2576519 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -4,7 +4,6 @@ using ImGui; using GlitchyEngine; using GlitchyEditor.EditWindows; using GlitchyEngine.Events; -using GlitchyEngine.ImGui; using GlitchyEngine.Math; using GlitchyEngine.Renderer; using GlitchyEngine.World; @@ -17,6 +16,7 @@ using GlitchyEngine.Core; using GlitchyEditor.Assets; using GlitchyEngine.Scripting; using GlitchyEditor.Platform.Windows; +using GlitchyEditor.ImGui; namespace GlitchyEditor { @@ -777,8 +777,8 @@ namespace GlitchyEditor if (Directory.Exists(project.WorkspacePath)) { - Application.Instance.Settings.EditorSettings.LastOpenedProject = project.WorkspacePath; - Application.Instance.Settings.Save(); + EditorApp.Instance.Settings.EditorSettings.LastOpenedProject = project.WorkspacePath; + EditorApp.Instance.Settings.Save(); } return .Ok; @@ -811,7 +811,7 @@ namespace GlitchyEditor Log.EngineLogger.AssertDebug(_scriptSerializer.SerializedObjectCount == 0, "Somehow some entities are serialized."); - if (Application.Instance.Settings.EditorSettings.ClearLogOnPlay) + if (EditorApp.Instance.Settings.EditorSettings.ClearLogOnPlay) Editor.Instance.LogWindow.ClearLog(); _scriptSerializer.SerializeScriptInstances(); @@ -830,7 +830,7 @@ namespace GlitchyEditor _editor.CurrentScene = _activeScene; - if (Application.Instance.Settings.EditorSettings.SwitchToPlayerOnPlay) + if (EditorApp.Instance.Settings.EditorSettings.SwitchToPlayerOnPlay) SwitchToPlayWindow(); } @@ -887,7 +887,7 @@ namespace GlitchyEditor _editor.CurrentScene = _activeScene; - if (Application.Instance.Settings.EditorSettings.SwitchToPlayerOnSimulate) + if (EditorApp.Instance.Settings.EditorSettings.SwitchToPlayerOnSimulate) SwitchToPlayWindow(); } @@ -896,7 +896,7 @@ namespace GlitchyEditor { _isPaused = true; - if (Application.Instance.Settings.EditorSettings.SwitchToEditorOnPause) + if (EditorApp.Instance.Settings.EditorSettings.SwitchToEditorOnPause) SwitchToEditorWindow(); } @@ -905,7 +905,7 @@ namespace GlitchyEditor { _isPaused = false; - if (Application.Instance.Settings.EditorSettings.SwitchToPlayerOnResume) + if (EditorApp.Instance.Settings.EditorSettings.SwitchToPlayerOnResume) SwitchToPlayWindow(); } @@ -918,6 +918,9 @@ namespace GlitchyEditor /// Stops the simulation or game and returns to edit mode. private void OnSceneStop() { + if (_activeScene == null) + return; + SetActiveScene(_editorScene, startRuntime: true, startSimulation: false, newPlayMode: .Editor); // TODO: _editorScene.DeserializeScripts(scriptData); @@ -939,7 +942,7 @@ namespace GlitchyEditor GameViewportSizeChanged(null, _editor.GameViewportWindow.RenderedViewportSize); } - if (Application.Instance.Settings.EditorSettings.SwitchToEditorOnStop) + if (EditorApp.Instance.Settings.EditorSettings.SwitchToEditorOnStop) SwitchToEditorWindow(); // Reconstruct state before play @@ -1394,7 +1397,7 @@ namespace GlitchyEditor private void ShowOpenRecentProjectMenu() { - let recentProjects = Application.Instance.Settings.EditorSettings.RecentProjects; + let recentProjects = EditorApp.Instance.Settings.EditorSettings.RecentProjects; if (recentProjects == null) return; diff --git a/GlitchyEditor/src/EditorSettings.bf b/GlitchyEditor/src/EditorSettings.bf index 94be3e5..b3204aa 100644 --- a/GlitchyEditor/src/EditorSettings.bf +++ b/GlitchyEditor/src/EditorSettings.bf @@ -8,7 +8,7 @@ using System.IO; using System.Diagnostics; using System.Threading; -namespace GlitchyEngine +namespace GlitchyEditor { extension Settings { diff --git a/GlitchyEngine/src/ImGui/ImGuiExtension.bf b/GlitchyEditor/src/ImGui/ImGuiExtension.bf similarity index 100% rename from GlitchyEngine/src/ImGui/ImGuiExtension.bf rename to GlitchyEditor/src/ImGui/ImGuiExtension.bf diff --git a/GlitchyEngine/src/ImGui/ImGuiLayer.bf b/GlitchyEditor/src/ImGui/ImGuiLayer.bf similarity index 98% rename from GlitchyEngine/src/ImGui/ImGuiLayer.bf rename to GlitchyEditor/src/ImGui/ImGuiLayer.bf index 58a7714..656f83b 100644 --- a/GlitchyEngine/src/ImGui/ImGuiLayer.bf +++ b/GlitchyEditor/src/ImGui/ImGuiLayer.bf @@ -2,9 +2,10 @@ using System; using ImGui; +using GlitchyEngine; using GlitchyEngine.Events; -using ImGuizmo; using GlitchyEngine.Renderer; +using ImGuizmo; using System.IO; using internal ImGui; @@ -17,7 +18,7 @@ using internal GlitchyEngine.Platform.DX11; #endif -namespace GlitchyEngine.ImGui +namespace GlitchyEditor.ImGui { public class ImGuiLayer : Layer { @@ -91,7 +92,7 @@ namespace GlitchyEngine.ImGui private void LoadFont() { - var settings = Application.Instance.Settings.ImGuiSettings; + var settings = EditorApp.Instance.Settings.ImGuiSettings; ImGui.GetIO().Fonts.Clear(); @@ -256,6 +257,11 @@ namespace GlitchyEngine.ImGui ImGui.RenderPlatformWindowsDefault(); } } + + public override void Update(GameTime gameTime) + { + ImGuiRender(); + } } } diff --git a/GlitchyEngine/src/ImGui/ImGuiRenderEvent.bf b/GlitchyEditor/src/ImGui/ImGuiRenderEvent.bf similarity index 92% rename from GlitchyEngine/src/ImGui/ImGuiRenderEvent.bf rename to GlitchyEditor/src/ImGui/ImGuiRenderEvent.bf index d706b47..90dd8e9 100644 --- a/GlitchyEngine/src/ImGui/ImGuiRenderEvent.bf +++ b/GlitchyEditor/src/ImGui/ImGuiRenderEvent.bf @@ -8,7 +8,7 @@ namespace GlitchyEngine.Events } } -namespace GlitchyEngine.ImGui +namespace GlitchyEditor.ImGui { public class ImGuiRenderEvent : Event, IEvent { diff --git a/GlitchyEngine/src/Platform/DX11/ImGui/Dx11ImGui.bf b/GlitchyEditor/src/Platform/DX11/ImGui/Dx11ImGui.bf similarity index 100% rename from GlitchyEngine/src/Platform/DX11/ImGui/Dx11ImGui.bf rename to GlitchyEditor/src/Platform/DX11/ImGui/Dx11ImGui.bf diff --git a/GlitchyEditor/src/Project.bf b/GlitchyEditor/src/Project.bf index 59e9267..9f46d71 100644 --- a/GlitchyEditor/src/Project.bf +++ b/GlitchyEditor/src/Project.bf @@ -461,7 +461,7 @@ class Project bool referenceScriptCoreProject = false; #if DEBUG - Settings settings = Application.Instance.Settings; + Settings settings = EditorApp.Instance.Settings; referenceScriptCoreProject = settings.DevSettings.UseScriptCoreDll; #endif diff --git a/GlitchyEngine/src/Settings.bf b/GlitchyEditor/src/Settings.bf similarity index 93% rename from GlitchyEngine/src/Settings.bf rename to GlitchyEditor/src/Settings.bf index 7ae9753..7e3a391 100644 --- a/GlitchyEngine/src/Settings.bf +++ b/GlitchyEditor/src/Settings.bf @@ -3,8 +3,9 @@ using ImGui; using System.Collections; using System.IO; using Bon; +using GlitchyEngine; -namespace GlitchyEngine +namespace GlitchyEditor { interface ISettings { @@ -84,7 +85,7 @@ namespace GlitchyEngine public static void Load() { - Settings settings = Application.Get().Settings; + Settings settings = EditorApp.Instance.Settings; if (!File.Exists("./settings.bon")) { @@ -96,7 +97,7 @@ namespace GlitchyEngine if (result case .Err) Log.EngineLogger.Error("Failed to deserialze settings."); - Application.Get().Settings.Apply(); + settings.Apply(); } public void Save() @@ -138,7 +139,7 @@ namespace GlitchyEngine public void Apply() { - Application.Instance.[Friend]_imGuiLayer.SettingsInvalid = true; + EditorApp.Instance.[Friend]_imGuiLayer.SettingsInvalid = true; } } #endif diff --git a/GlitchyEditor/src/SettingsWindow.bf b/GlitchyEditor/src/SettingsWindow.bf index ca6a1e1..6088176 100644 --- a/GlitchyEditor/src/SettingsWindow.bf +++ b/GlitchyEditor/src/SettingsWindow.bf @@ -59,7 +59,7 @@ namespace GlitchyEditor { _open = false; - _settings = Application.Instance.Settings; + _settings = EditorApp.Instance.Settings; Create(); } diff --git a/GlitchyEngine/BeefProj.toml b/GlitchyEngine/BeefProj.toml index 5be58c1..d207fac 100644 --- a/GlitchyEngine/BeefProj.toml +++ b/GlitchyEngine/BeefProj.toml @@ -11,10 +11,6 @@ DirectX = "*" FreeType = "*" cgltf-beef = "*" msdfgen-beef = "*" -ImGui = "*" -ImGuiImplDX11 = "*" -ImGuiImplWin32 = "*" -ImGuizmo = "*" Beefy2D = "*" LodePng = "*" GlitchyEngineHelper = "*" @@ -22,6 +18,7 @@ bon = "*" box2d-beef = "*" "Beef.Linq" = "*" NetHostBeef = "*" +ImGuiImplWin32 = "*" [Configs.Paranoid.Win32] PreprocessorMacros = ["DEBUG", "PARANOID", "GE_WINDOWS"] @@ -33,7 +30,7 @@ PreprocessorMacros = ["DEBUG", "PARANOID", "GE_WINDOWS"] PreprocessorMacros = ["RELEASE", "GE_WINDOWS"] [Configs.Release.Win64] -PreprocessorMacros = ["IMGUI", "RELEASE", "GE_PROFILE"] +PreprocessorMacros = ["RELEASE", "GE_PROFILE", "GE_PROFILE_RENDERER", "GE_PROFILE_RESOURCES", "GE_RESOURCE_DEBUG_NAMES"] [Configs.Test.Win32] PreprocessorMacros = ["TEST", "GE_WINDOWS"] @@ -42,4 +39,4 @@ PreprocessorMacros = ["TEST", "GE_WINDOWS"] PreprocessorMacros = ["TEST", "GE_PROFILE", "GE_PROFILE_RENDERER", "GE_PROFILE_RESOURCES", "IMGUI", "GE_RESOURCE_DEBUG_NAMES"] [Configs.Debug.Win64] -PreprocessorMacros = ["DEBUG", "GE_PROFILE", "GE_PROFILE_RENDERER", "GE_PROFILE_RESOURCES", "IMGUI", "GE_RESOURCE_DEBUG_NAMES"] +PreprocessorMacros = ["DEBUG", "GE_PROFILE", "GE_PROFILE_RENDERER", "GE_PROFILE_RESOURCES", "GE_RESOURCE_DEBUG_NAMES"] diff --git a/GlitchyEngine/src/Application.bf b/GlitchyEngine/src/Application.bf index e96103d..87bc37d 100644 --- a/GlitchyEngine/src/Application.bf +++ b/GlitchyEngine/src/Application.bf @@ -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; diff --git a/GlitchyEngine/src/Input.bf b/GlitchyEngine/src/Input.bf index 2660343..3a21658 100644 --- a/GlitchyEngine/src/Input.bf +++ b/GlitchyEngine/src/Input.bf @@ -66,7 +66,7 @@ namespace GlitchyEngine public static extern void Impl_NewFrame(); public static extern void Impl_EndFrame(); - public static void ImGuiDebugDraw() + /*public static void ImGuiDebugDraw() { if (ImGui.Begin("Input")) { @@ -116,7 +116,7 @@ namespace GlitchyEngine } ImGui.End(); - } + }*/ } public static class Mouse diff --git a/GlitchyEngine/src/LayerStack.bf b/GlitchyEngine/src/LayerStack.bf index 9b0ebc9..62d79fe 100644 --- a/GlitchyEngine/src/LayerStack.bf +++ b/GlitchyEngine/src/LayerStack.bf @@ -58,6 +58,7 @@ namespace GlitchyEngine { _insertIndex--; layer.OnDetach(); + delete layer; } } @@ -70,6 +71,7 @@ namespace GlitchyEngine if(_layers.Remove(overlay)) { overlay.OnDetach(); + delete overlay; } } diff --git a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf index cbe2e3a..105e58a 100644 --- a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf +++ b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf @@ -275,7 +275,10 @@ namespace GlitchyEngine return DefWindowProcW(hwnd, uMsg, wParam, lParam); } + // TODO: This line is the reason why GlitchyEngine depends on ImGui... +#if IMGUI ImGui.ImGuiImplWin32.WndProcHandler(hwnd, uMsg, wParam, lParam); +#endif switch (uMsg) {