Window works now!

This commit is contained in:
2026-02-20 11:40:12 +00:00
parent 6d22df0c46
commit 12572c8775
2 changed files with 31 additions and 0 deletions

View File

@@ -1,6 +1,18 @@
#include "first_app.hpp"
#include <stdexcept>
namespace cve {
FirstApp::FirstApp() {
createPipelineLayout();
createPipeline();
createCommandBuffers();
}
FirstApp::~FirstApp() {
vkDestroyPipelineLayout(cveDevice.device(), pipelineLayout, nullptr);
}
void FirstApp::run() {
while (!cveWindow.shouldClose()) {
glfwPollEvents();
@@ -13,5 +25,24 @@ namespace cve {
pipelineLayoutInfo.pSetLayouts = nullptr;
pipelineLayoutInfo.pushConstantRangeCount = 0;
pipelineLayoutInfo.pPushConstantRanges = nullptr;
if (vkCreatePipelineLayout(cveDevice.device(), &pipelineLayoutInfo, nullptr, &pipelineLayout) !=
VK_SUCCESS) {
throw std::runtime_error("Failed to create pipeline layout");
}
}
void FirstApp::createPipeline() {
auto pipelineConfig = CvePipeline::defaultPipelineConfigInfo(cveSwapChain.width(), cveSwapChain.height());
pipelineConfig.renderPass = cveSwapChain.getRenderPass();
pipelineConfig.pipelineLayout = pipelineLayout;
cvePipeline = std::make_unique<CvePipeline>(
cveDevice,
"shaders/simple_shader.vert.spv",
"shaders/simple_shader.frag.spv",
pipelineConfig
);
}
void FirstApp::createCommandBuffers() {};
void FirstApp::drawFrame() {};
}