Skip to content

Conversation

@rapfamily4
Copy link

Added a snippet of C++ code which handles exceptions thrown by vkQueuePresentKHR in the swapchain recreation chapter.
The snippet was already present in the attached code, but absent from the tutorial text.
Not using the try-catch, as shown in the tutorial, will break the program while resizing the window on some machines.

}
----

Recent versions of the Vulkan CPP header throw exceptions on unsuccessful return codes. To handle exceptions thrown by `vkQueuePresentKHR`, catch `vk::SystemError` and check the error code as shown above.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but can you replace the Vulkan CPP header" with "Vulkan-hpp"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants