|
|
@ -60,7 +60,7 @@ static void check_vk_result(VkResult err) |
|
|
|
abort(); |
|
|
|
} |
|
|
|
|
|
|
|
static void resize_vulkan(GLFWwindow*, int w, int h) |
|
|
|
static void CreateOrResizeSwapChainAndFrameBuffer(int w, int h) |
|
|
|
{ |
|
|
|
VkResult err; |
|
|
|
VkSwapchainKHR old_swapchain = g_Swapchain; |
|
|
@ -189,6 +189,11 @@ static void resize_vulkan(GLFWwindow*, int w, int h) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void GlfwResizeCallback(GLFWwindow*, int w, int h) |
|
|
|
{ |
|
|
|
CreateOrResizeSwapChainAndFrameBuffer(w, h); |
|
|
|
} |
|
|
|
|
|
|
|
#ifdef IMGUI_VULKAN_DEBUG_REPORT |
|
|
|
static VKAPI_ATTR VkBool32 VKAPI_CALL debug_report(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage, void* pUserData) |
|
|
|
{ |
|
|
@ -340,8 +345,8 @@ static void setup_vulkan(GLFWwindow* window, const char** extensions, uint32_t e |
|
|
|
{ |
|
|
|
int w, h; |
|
|
|
glfwGetFramebufferSize(window, &w, &h); |
|
|
|
resize_vulkan(window, w, h); |
|
|
|
glfwSetFramebufferSizeCallback(window, resize_vulkan); |
|
|
|
CreateOrResizeSwapChainAndFrameBuffer(w, h); |
|
|
|
glfwSetFramebufferSizeCallback(window, GlfwResizeCallback); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|