From 4315c6c5ecb81a6f5781c6733f005bb331302e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 15 Sep 2024 21:39:46 +0200 Subject: [PATCH] Fixed swapchain with zero size (auto detect resolution) --- GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf b/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf index 975051b..2e64e93 100644 --- a/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf +++ b/GlitchyEngine/src/Platform/DX11/Renderer/Dx11SwapChain.bf @@ -112,6 +112,14 @@ namespace GlitchyEngine.Renderer factory.Release(); } + if (_width == 0 || _height == 0) + { + nativeSwapChain.GetDescription1(let desc); + + _width = desc.Width; + _height = desc.Height; + } + RenderTarget2DDescription desc = .(backBufferFormat, _width, _height); desc.DepthStencilFormat = _depthStencilFormat; desc.SwapChain = this;