Changeset 28ea92f in opengl-game for sdl-game.cpp
- Timestamp:
- Feb 14, 2021, 3:12:38 AM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 737c26a
- Parents:
- 4e2c709
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sdl-game.cpp
r4e2c709 r28ea92f 15 15 16 16 #define IMGUI_UNLIMITED_FRAME_RATE 17 18 static bool g_SwapChainRebuild = false;19 17 20 18 static void check_imgui_vk_result(VkResult res) { … … 172 170 173 171 // Resize swap chain? 174 if ( g_SwapChainRebuild) {172 if (shouldRecreateSwapChain) { 175 173 int width, height; 176 174 SDL_GetWindowSize(window, &width, &height); … … 184 182 185 183 imageIndex = 0; 186 g_SwapChainRebuild= false;184 shouldRecreateSwapChain = false; 187 185 } 188 186 } … … 823 821 824 822 if (result == VK_ERROR_OUT_OF_DATE_KHR) { 825 g_SwapChainRebuild= true;823 shouldRecreateSwapChain = true; 826 824 return; 827 } 828 else { 825 } else { 829 826 VKUTIL_CHECK_RESULT(result, "failed to acquire swap chain image!"); 830 827 } … … 895 892 896 893 void VulkanGame::presentFrame() { 897 if ( g_SwapChainRebuild)894 if (shouldRecreateSwapChain) { 898 895 return; 896 } 899 897 900 898 VkSemaphore signalSemaphores[] = { renderCompleteSemaphores[currentFrame] }; … … 914 912 // to framebufferResized, but not quite the same 915 913 if (result == VK_ERROR_OUT_OF_DATE_KHR) { 916 g_SwapChainRebuild= true;914 shouldRecreateSwapChain = true; 917 915 return; 918 } 919 else if (result != VK_SUCCESS) { 916 } else if (result != VK_SUCCESS) { 920 917 throw runtime_error("failed to present swap chain image!"); 921 918 }
Note:
See TracChangeset
for help on using the changeset viewer.