A swapchain is used to display images on screen. It is an array of images which can be acquired by the application and then presented in our application's window. Each image has the same defined set of properties. When we have prepared all of these parameters, meaning that we chose a number, a size, a format, and usage scenarios for swapchain images, and also acquired and selected one of the available presentation modes, we are ready to create a swapchain.
Creating a swapchain
How to do it...
- Take the handle of a created logical device object. Store it in a variable of type VkDevice named logical_device.
- Assign the handle of a created presentation surface to a variable of type VkSurfaceKHR named presentation_surface.
- Take the desired number of swapchain images...