Show ImGui DemoWindow in EditorLayer

This commit is contained in:
Simon Lübeß
2024-02-26 13:40:00 +01:00
parent 0a822dcd79
commit aa29207e72
2 changed files with 15 additions and 2 deletions
+15
View File
@@ -111,6 +111,10 @@ namespace GlitchyEditor
private AssetThumbnailManager _thumbnailManager ~ delete _; private AssetThumbnailManager _thumbnailManager ~ delete _;
#if GE_EDITOR_IMGUI_DEMO
private bool _showImguiDemoWindow;
#endif
[AllowAppend] [AllowAppend]
public this(String[] args, EditorContentManager contentManager) : base("Editor") public this(String[] args, EditorContentManager contentManager) : base("Editor")
{ {
@@ -1214,6 +1218,13 @@ namespace GlitchyEditor
DrawMainMenuBar(); DrawMainMenuBar();
#if GE_EDITOR_IMGUI_DEMO
if (_showImguiDemoWindow)
{
ImGui.ShowDemoWindow();
}
#endif
_editor.SceneViewportWindow.RenderTarget = _editorViewportTarget; _editor.SceneViewportWindow.RenderTarget = _editorViewportTarget;
_editor.GameViewportWindow.RenderTarget = _gameViewportTarget; _editor.GameViewportWindow.RenderTarget = _gameViewportTarget;
@@ -1535,6 +1546,10 @@ namespace GlitchyEditor
if(ImGui.MenuItem("Reload Scripts")) if(ImGui.MenuItem("Reload Scripts"))
ScriptEngine.ReloadAssemblies(); ScriptEngine.ReloadAssemblies();
#if GE_EDITOR_IMGUI_DEMO
ImGui.Checkbox("Show ImGui Demo", &_showImguiDemoWindow);
#endif
ImGui.EndMenu(); ImGui.EndMenu();
} }
-2
View File
@@ -211,8 +211,6 @@ namespace GlitchyEngine.ImGui
Begin(); Begin();
ImGui.ShowDemoWindow();
{ {
Debug.Profiler.ProfileScope!("ImGuiRenderEvent"); Debug.Profiler.ProfileScope!("ImGuiRenderEvent");