LE TRIANGLE
This commit is contained in:
@@ -17,6 +17,7 @@ namespace cve {
|
|||||||
void FirstApp::run() {
|
void FirstApp::run() {
|
||||||
while (!cveWindow.shouldClose()) {
|
while (!cveWindow.shouldClose()) {
|
||||||
glfwPollEvents();
|
glfwPollEvents();
|
||||||
|
drawFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void FirstApp::createPipelineLayout() {
|
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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user