Basic multiple windows working

This commit is contained in:
Simon Lübeß
2024-09-10 23:02:34 +02:00
parent 352073869f
commit 2e3c0d0aa4
6 changed files with 128 additions and 22 deletions
+15 -3
View File
@@ -15,6 +15,9 @@ namespace GlitchyEngine
static Application s_Instance = null;
private Window _mainWindow;
private append List<Window> _windows = .();
private RendererAPI _rendererApi;
private bool _running = true;
@@ -53,6 +56,8 @@ namespace GlitchyEngine
public Settings Settings {get; private set;} = new .() ~ delete _;
public List<Window> Windows => _windows;
public this()
{
Profiler.ProfileFunction!();
@@ -122,7 +127,11 @@ namespace GlitchyEngine
delete _layerStack;
delete _rendererApi;
delete _mainWindow;
while (!_windows.IsEmpty)
{
delete _windows.Back;
}
delete _gameTime;
@@ -197,8 +206,11 @@ namespace GlitchyEngine
#if IMGUI
_imGuiLayer.ImGuiRender();
#endif
_mainWindow.SwapChain.Present();
for (Window window in _windows)
{
window.SwapChain.Present();
}
}
}
}