From e1c7f2d80a25959fad5af479715b2d42dbedb136 Mon Sep 17 00:00:00 2001 From: connellpaxton Date: Tue, 23 Jan 2024 16:08:29 -0500 Subject: [PATCH] Introduced temporary solution to window minimization. --- Renderer/Swapchain.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Renderer/Swapchain.cpp b/Renderer/Swapchain.cpp index 974b4c6..7bb69a0 100644 --- a/Renderer/Swapchain.cpp +++ b/Renderer/Swapchain.cpp @@ -6,6 +6,10 @@ #include +/* TODO: Make solution that doesn't involve using GLFW directly here for minimization */ +#include + + Swapchain::Swapchain(Window& win, vk::Device dev, vk::PhysicalDevice phys_dev, const vk::SurfaceKHR& surface, RenderPass render_pass) : win(win), dev(dev), phys_dev(phys_dev), surface(surface), render_pass(render_pass) { create(); @@ -130,6 +134,12 @@ void Swapchain::create(vk::SwapchainKHR old_swapchain) { void Swapchain::recreate() { + vk::Extent2D ext; + do { + ext = win.getDimensions(); + glfwWaitEvents(); + } while (!ext.width || !ext.height); + dev.waitIdle(); cleanup(); auto save = swapchain;