Creating a swapchain with R8G8B8A8 format and a mailbox present mode
To create a swapchain, we need to acquire a lot of additional information and prepare a considerable number of parameters. To present the order of all the steps required for the preparation phases and how to use the acquired information, we will create a swapchain with arbitrarily chosen parameters. For it, we will set a mailbox presentation mode, the most commonly used R8G8B8A8 color format with unsigned normalized values (similar to OpenGL's RGBA8 format), no transformations, and a standard color attachment image usage.
How to do it...
- Prepare a physical device handle. Store it in a variable of type
VkPhysicalDevice
namedphysical_device
. - Take the handle of a created presentation surface and assign it to a variable of type
VkSurfaceKHR
namedpresentation_surface
. - Take the logical device created from the handle represented by the
physical_device
variable. Store the handle of the logical device in a variable of typeVkDevice...