The Vulkan Context class will include all the functionality we need so that we can create our Vulkan renderer. In this class, we will create the validation layer, create the Vulkan application and instance, select the GPU we want to use, create the swapchain, create render targets, create the render pass, and add the command buffers so that we can send our draw commands to the GPU.
We will also add two new functions: drawBegin and drawEnd. In the drawBegin function, we will add the functionality for the preparation stages of drawing. The drawEnd function will be called after we have drawn an object and prepared it so that it can be presented to the viewport.
Create a new .h class and .cpp file. In the .h file, include the following code:
#defineGLFW_INCLUDE_VULKAN #include<GLFW\glfw3.h> #include<vulkan\vulkan.h> #include"AppValidationLayersAndExtensions...