The presentation surface represents the window of our application. It is used, among other purposes, during swapchain creation. That's why we should destroy the presentation surface after the destruction of a swapchain that is based on a given surface is finished.
Destroying a presentation surface
How to do it...
- Prepare the handle of a Vulkan Instance and store it in a variable of type VkInstance named instance.
- Take the handle of a presentation surface and assign it to the variable of type VkSurfaceKHR named presentation_surface.
- Call vkDestroySurfaceKHR( instance, presentation_surface, nullptr ) and provide the instance and presentation_surface variables in the first two parameters and a nullptr value in the last parameter.
- For safety reasons, assign a VK_NULL_HANDLE...