Creating a presentation surface
A presentation surface represents an application's window. It allows us to acquire the window's parameters, such as dimensions, supported color formats, required number of images, or presentation modes. It also allows us to check whether a given physical device is able to display an image in a given window.
That's why, in situations where we want to show an image on screen, we need to create a presentation surface first, as it will help us choose a physical device that suits our needs.
Getting ready
To create a presentation surface, we need to provide the parameters of an application's window. In order to do that, the window must have been already created. In this recipe, we will provide its parameters through a structure of type WindowParameters
. Its definition looks like this:
struct WindowParameters { #ifdef VK_USE_PLATFORM_WIN32_KHR HINSTANCE HInstance; HWND HWnd; #elif defined VK_USE_PLATFORM_XLIB_KHR Display * Dpy...