Creating a Vulkan Instance with WSI extensions enabled
To be able to properly display images on screen, we need to enable a set of WSI extensions. They are divided into instance- and device-levels, depending on the functionality they introduce. The first step is to create a Vulkan Instance with a set of enabled extensions that allow us to create a presentation surface--a Vulkan representation of an application's window.
How to do it...
On the Windows operating systems family, perform the following steps:
- Prepare a variable of type
VkInstance
namedinstance
. - Prepare a variable of type
std::vector<char const *>
nameddesired_extensions
. Store the names of all extensions you want to enable in thedesired_extensions
variable. - Add another element to the
desired_extensions
vector with theVK_KHR_SURFACE_EXTENSION_NAME
value. - Add yet another element to the
desired_extensions
vector with theVK_KHR_WIN32_SURFACE_EXTENSION_NAME
value. - Create a Vulkan Instance object for which enable all of the extensions...