To use the AppValidationLayerAndExtension class, we have to create a Vulkan instance. To do so, follow these steps:
- We will create another class called VulkanInstance. In VulkanInstance.h, add the following code:
#pragmaonce #include<vulkan\vulkan.h> #include"AppValidationLayersAndExtensions.h" classVulkanInstance { public: VulkanInstance(); ~VulkanInstance(); VkInstance vkInstance; void createAppAndVkInstance(,boolenableValidationLayers AppValidationLayersAndExtensions *valLayersAndExtentions); };
We're including vulkan.h and AppValidationLayersAndExtentions.h since we will need the required validation layers and extensions when we create the Vulkan instance. We add the constructor, destructor, and instance of VkInstance, as well as a function called ceeateAppAndVkInstance. This function takes...