fixing window resizing

This commit is contained in:
2024-12-04 14:04:44 +01:00
parent 122f4e8403
commit b7183a1058
9 changed files with 90 additions and 61 deletions

View File

@@ -27,6 +27,7 @@ namespace mlx
if(m_resize)
{
RenderCore::Get().WaitDeviceIdle();
Destroy();
CreateSwapchain();
EventBus::SendBroadcast(Internal::ResizeEventBroadcast{});
}
@@ -76,8 +77,6 @@ namespace mlx
extent = { size.x, size.y };
} while(extent.width == 0 || extent.height == 0);
Destroy();
m_surface = p_window->CreateVulkanSurface(RenderCore::Get().GetInstance());
DebugLog("Vulkan: surface created");
m_swapchain = kvfCreateSwapchainKHR(RenderCore::Get().GetDevice(), RenderCore::Get().GetPhysicalDevice(), m_surface, extent, VK_NULL_HANDLE, false);