To get access to SwapChain, RenderPass, and the current command buffer, we will add the following functions to the VulkanContext.h file under the VulkanContext class in the public section:
void drawBegin(); void drawEnd(); void cleanup(); SwapChain* getSwapChain(); Renderpass* getRenderpass(); VkCommandBuffer getCurrentCommandBuffer();
Then, in the VulkanContext.cpp file, add the implementation for accessing the values:
SwapChain * VulkanContext::getSwapChain() {
return swapChain;
}
Renderpass * VulkanContext::getRenderpass() {
return renderPass;
}
VkCommandBuffer VulkanContext::getCurrentCommandBuffer() {
return curentCommandBuffer;
}