From 4401d8094801bd0908b6644aba880ebfc012de5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Fri, 13 Nov 2020 13:47:47 +0100 Subject: [PATCH] Fixed backbuffer resolution on startup and after maximizing --- GlitchyEngine/src/Platform/Windows/WindowsWindow.bf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf index 3bb9ad3..d391a10 100644 --- a/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf +++ b/GlitchyEngine/src/Platform/Windows/WindowsWindow.bf @@ -213,6 +213,7 @@ namespace GlitchyEngine.Platform.Windows { SplitHighAndLowOrder!(lParam, out window._clientRect.Width, out window._clientRect.Height); + DirectX.UpdateSwapchain((.)window._clientRect.Width, (.)window._clientRect.Height); WindowResizeEvent event = scope WindowResizeEvent(window._clientRect.Width, window._clientRect.Height, window._isResizingOrMoving); window._eventCallback(event); } @@ -244,7 +245,7 @@ namespace GlitchyEngine.Platform.Windows { window._isResizingOrMoving = false; - DirectX.UpdateSwapchain((.)window.Width, (.)window.Height); + DirectX.UpdateSwapchain((.)window._clientRect.Width, (.)window._clientRect.Width); var resEvent = scope WindowResizeEvent(window._clientRect.Width, window._clientRect.Height, false); window._eventCallback(resEvent); @@ -403,7 +404,7 @@ namespace GlitchyEngine.Platform.Windows private void LoadWindowRectangle() { - GetWindowRect(_windowHandle, let rectangle); + GetClientRect(_windowHandle, let rectangle); _clientRect.X = rectangle.Left; _clientRect.Y = rectangle.Top;