We need an interface for the window we created for the current platform so that we can present the images we will render. We use the VKSurfaceKHR property to get access to the window surface. To store the surface information that the OS supports, we will call the glfw function, glfwCreateWindowSurface, to create the surface that's supported by the OS.
In VulkanContext.h, add a new variable of the VkSurfaceKHR type called surface, as follows:
private: //surface VkSurfaceKHR surface;
Since we need access to the window instance we created in source.cpp, change the initVulkan function so that it accepts a GLFWwindow, as follows:
void initVulkan(GLFWwindow* window);
In VulkanContext.cpp, change the initVulkan implementation as follows and call the glfwCreateWindowSurface function, which takes in the Vulkan instance and the window...