vulkan/win32: Provide reasonable default swapchain.

If extents are reported 0xffffffff, swapchain expects a provided
default size.
This commit is contained in:
BearOso 2023-02-18 17:25:23 -06:00
parent 19787b12f1
commit 4f08da4cd8
2 changed files with 6 additions and 4 deletions

View File

@ -110,6 +110,11 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width,
swapchain_object.reset();
return false;
}
else if (extents.width > 8192 || extents.height > 8192)
{
extents.width = 512;
extents.height = 512;
}
auto swapchain_create_info = vk::SwapchainCreateInfoKHR{}
.setMinImageCount(num_swapchain_images)

View File

@ -147,10 +147,7 @@ void COpenGL::DeInitialize()
wglDeleteContext(hRC);
hRC = NULL;
}
if(hDC) {
ReleaseDC(hWnd,hDC);
hDC = NULL;
}
hDC = NULL;
hWnd = NULL;
afterRenderWidth = 0;
afterRenderHeight = 0;