2#include <vulkan/vulkan.h>
19 FrameManager(VkDevice dev, VkQueue graphicsQ, VkQueue presentQ, VkSwapchainKHR sc, uint32_t framesInFlight = 2);
29 void init(VkCommandPool commandPool);
void init(VkCommandPool commandPool)
Allocates command buffers and creates semaphores and fences.
Definition FrameManager.cpp:31
VkQueue presentQueue
Definition FrameManager.hpp:50
void endFrame(uint32_t imageIndex)
Submits command buffers to the graphics queue and presents the swapchain image.
Definition FrameManager.cpp:81
VkCommandBuffer getCurrentCommandBuffer() const
Gets command buffer active for the current in-flight frame.
Definition FrameManager.hpp:45
std::vector< VkCommandBuffer > commandBuffers
Definition FrameManager.hpp:57
std::vector< VkSemaphore > renderFinishedSemaphores
Definition FrameManager.hpp:55
VkDevice device
Definition FrameManager.hpp:48
VkQueue graphicsQueue
Definition FrameManager.hpp:49
~FrameManager()
Destroy the Frame Manager object, releasing sync handles.
Definition FrameManager.cpp:19
std::vector< VkFence > inFlightFences
Definition FrameManager.hpp:56
VkSwapchainKHR swapchain
Definition FrameManager.hpp:51
uint32_t maxFramesInFlight
Definition FrameManager.hpp:52
std::vector< VkSemaphore > imageAvailableSemaphores
Definition FrameManager.hpp:54
uint32_t currentFrame
Definition FrameManager.hpp:59
void beginFrame(uint32_t &imageIndex)
Prepares for frame drawing by waiting for the in-flight fence, acquiring the next swapchain image,...
Definition FrameManager.cpp:68
FrameManager(VkDevice dev, VkQueue graphicsQ, VkQueue presentQ, VkSwapchainKHR sc, uint32_t framesInFlight=2)
Construct a new Frame Manager object.
Definition FrameManager.cpp:12