In the VulkanApplication.h file, we will add three new functions, called drawBegin, drawEnd, and cleanup. drawBegin will be called before we pass in any draw commands, and drawEnd will be called once the drawing is done and the frame is ready to be presented to the viewport. In the cleanup function, we will destroy all the resources.
We will also create two variables. The first is uint32_t, to get the current picture from the swapchain, and the second is currentCommandBuffer of the VkCommandBuffer type to get the current command buffer:
public: static VulkanApplication* getInstance(); static VulkanApplication* instance; ~VulkanApplication(); void initVulkan(GLFWwindow* window); void drawBegin(); void drawEnd(); void cleanup(); private: uint32_t imageIndex = 0; VkCommandBuffer currentCommandBuffer; ...