File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,18 +113,7 @@ class HelloTriangleApplication {
113113 void mainLoop () {
114114 while (!glfwWindowShouldClose (window)) {
115115 glfwPollEvents ();
116- try {
117- drawFrame ();
118- } catch (const vk::SystemError& e) {
119- if (e.code ().value () == static_cast <int >(vk::Result::eErrorOutOfDateKHR)) {
120- // Swapchain is out of date, this can happen during window close
121- // Just ignore and continue to close
122- std::cout << " Ignoring ErrorOutOfDateKHR during shutdown" << std::endl;
123- } else {
124- // Rethrow other errors
125- throw ;
126- }
127- }
116+ drawFrame ();
128117 }
129118
130119 device.waitIdle ();
@@ -537,11 +526,9 @@ class HelloTriangleApplication {
537526 }
538527 } catch (const vk::SystemError& e) {
539528 if (e.code ().value () == static_cast <int >(vk::Result::eErrorOutOfDateKHR)) {
540- // Swapchain is out of date, this can happen during window close
541- // Just ignore and continue to close
542- std::cout << " Ignoring ErrorOutOfDateKHR during presentation" << std::endl;
529+ recreateSwapChain ();
530+ return ;
543531 } else {
544- // Rethrow other errors
545532 throw ;
546533 }
547534 }
You can’t perform that action at this time.
0 commit comments