LE TRIANGLE

This commit is contained in:
2026-02-20 12:03:25 +00:00
parent 32ac2cd853
commit 0305dc32be
2 changed files with 14 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ namespace cve {
void FirstApp::run() {
while (!cveWindow.shouldClose()) {
glfwPollEvents();
drawFrame();
}
}
void FirstApp::createPipelineLayout() {
@@ -91,5 +92,17 @@ namespace cve {
}
}
}
void FirstApp::drawFrame() {};
void FirstApp::drawFrame() {
uint32_t imageIndex;
auto result = cveSwapChain.acquireNextImage(&imageIndex);
if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) {
throw std::runtime_error("Failed to acquire swap chain image!");
}
result = cveSwapChain.submitCommandBuffers(&commandBuffers[imageIndex], &imageIndex);
if (result != VK_SUCCESS) {
throw std::runtime_error("Failed to present swap chain image!");
}
}
}