From aa29207e7268a6673f50102ffb2352fe55a11751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Mon, 26 Feb 2024 13:40:00 +0100 Subject: [PATCH] Show ImGui DemoWindow in EditorLayer --- GlitchyEditor/src/EditorLayer.bf | 15 +++++++++++++++ GlitchyEngine/src/ImGui/ImGuiLayer.bf | 2 -- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index 1dff2c2..2df5bd8 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -111,6 +111,10 @@ namespace GlitchyEditor private AssetThumbnailManager _thumbnailManager ~ delete _; +#if GE_EDITOR_IMGUI_DEMO + private bool _showImguiDemoWindow; +#endif + [AllowAppend] public this(String[] args, EditorContentManager contentManager) : base("Editor") { @@ -1214,6 +1218,13 @@ namespace GlitchyEditor DrawMainMenuBar(); +#if GE_EDITOR_IMGUI_DEMO + if (_showImguiDemoWindow) + { + ImGui.ShowDemoWindow(); + } +#endif + _editor.SceneViewportWindow.RenderTarget = _editorViewportTarget; _editor.GameViewportWindow.RenderTarget = _gameViewportTarget; @@ -1535,6 +1546,10 @@ namespace GlitchyEditor if(ImGui.MenuItem("Reload Scripts")) ScriptEngine.ReloadAssemblies(); +#if GE_EDITOR_IMGUI_DEMO + ImGui.Checkbox("Show ImGui Demo", &_showImguiDemoWindow); +#endif + ImGui.EndMenu(); } diff --git a/GlitchyEngine/src/ImGui/ImGuiLayer.bf b/GlitchyEngine/src/ImGui/ImGuiLayer.bf index 1d6c02b..164c1c9 100644 --- a/GlitchyEngine/src/ImGui/ImGuiLayer.bf +++ b/GlitchyEngine/src/ImGui/ImGuiLayer.bf @@ -210,8 +210,6 @@ namespace GlitchyEngine.ImGui } Begin(); - - ImGui.ShowDemoWindow(); { Debug.Profiler.ProfileScope!("ImGuiRenderEvent");