Creating a surface
Just as in OpenGL, presenting the final render output to the screen needs support from the windowing system and is platform-dependent. For this reason, the Vulkan Core API does not contain functions to render the final image to the screen. Those functions and types are extensions. For this recipe, we’ll use the VK_KHR_surface
and VK_KHR_swapchain
extensions. We will cover only the Windows case here and use the VK_KHR_win32_surface
extension.
In this recipe, you will learn how to create a surface for presenting the final output of your rendering.
Getting ready
The first step in the process of rendering an image onto the screen starts with the creation of a VkSurfaceKHR
object. Since this object is needed while reserving queues from a physical device, this step is done after the instance has been created but before the physical devices are enumerated and before the device is created, as the device needs information about which queue families we will...