Creating a Vulkan instance

A Vulkan instance is a primary object that is required to build an application; it stores all the application states. It is of the type VkInstance and is managed inside the VulkanInstance class, which is user-defined (VulkanInstance.h/cpp). This class is responsible for the creation and destruction of the Vulkan instance object. The following is the implementation of the header file:

class VulkanInstance { // Many lines skipped 
 
     
    // Vulkan instance object variable 
    VkInstance instance; 
 
    // Vulkan instance specific layer and extensions 
    VulkanLayerAndExtension       layerExtension; 
 
    // Functions for Creation and Deletion of Vulkan instance VkResult createInstance( vector<const char *>& layers, vector<const char *>& extensions, ...

Get Learning Vulkan now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.