Better structure again (whoohoo)!

This commit is contained in:
2026-02-22 17:42:21 +00:00
parent 864c0247bb
commit d435be97e2
8 changed files with 23 additions and 7 deletions

View File

@@ -23,7 +23,12 @@ namespace cve {
VkCommandBuffer getCurrentCommandBuffer() const {
assert(isFrameStarted && "Cannot get command buffer when frame is not in progress");
return commandBuffers[currentImageIndex];
return commandBuffers[currentFrameIndex];
}
int getFrameIndex() const {
assert(isFrameStarted && "Cannot get frame index when frame is not started");
return currentFrameIndex;
}
VkCommandBuffer beginFrame();
@@ -41,7 +46,8 @@ namespace cve {
std::unique_ptr<CveSwapChain> cveSwapChain;
std::vector<VkCommandBuffer> commandBuffers;
uint32_t currentImageIndex;
uint32_t currentImageIndex = 0;
int currentFrameIndex = 0;
bool isFrameStarted = false;
};
}