While the scene is rendered, the buffers are swapped and presented to the window surface. The surface is platform-dependent and, depending upon the operating system, we have to choose the surface format accordingly. For the scene to be presented properly, we create the SwapChain, depending upon the surface format, presentation mode, and the extent, meaning the width and height, of the picture that the window can support.
In Chapter 10, Drawing Vulkan Objects, when we chose the GPU device to use, we retrieved the properties of the device, such as the surface format and the presentation modes it supports. While we create the SwapChain, we match and check the surface format and the presentation that is available from the device, and that is also supported by the window to create the SwapChain object itself.
We create a new class called SwapChain and add the following...