Window works now!
This commit is contained in:
@@ -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() {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user