More shader related stuff
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#include "cve_window.hpp"
|
#include "cve_window.hpp"
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace cve {
|
namespace cve {
|
||||||
CveWindow::CveWindow(int w, int h, std::string name) : width{w},
|
CveWindow::CveWindow(int w, int h, std::string name) : width{w},
|
||||||
height{h}, windowName{name} {
|
height{h}, windowName{name} {
|
||||||
@@ -19,4 +21,10 @@ namespace cve {
|
|||||||
window = glfwCreateWindow(width, height,
|
window = glfwCreateWindow(width, height,
|
||||||
windowName.c_str(), nullptr, nullptr);
|
windowName.c_str(), nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CveWindow::createWindowSurface(VkInstance instance, VkSurfaceKHR *surface) {
|
||||||
|
if (glfwCreateWindowSurface(instance, window, nullptr, surface) != VK_SUCCESS) {
|
||||||
|
throw std::runtime_error("Failed to create window surface");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ class CveWindow {
|
|||||||
CveWindow &operator=(const CveWindow &) = delete;
|
CveWindow &operator=(const CveWindow &) = delete;
|
||||||
|
|
||||||
bool shouldClose() { return glfwWindowShouldClose(window); };
|
bool shouldClose() { return glfwWindowShouldClose(window); };
|
||||||
|
|
||||||
|
void createWindowSurface(VkInstance instance, VkSurfaceKHR *surface);
|
||||||
private:
|
private:
|
||||||
void initWindow();
|
void initWindow();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "cve_window.hpp"
|
#include "cve_window.hpp"
|
||||||
|
#include "cve_pipeline.hpp"
|
||||||
|
|
||||||
namespace cve {
|
namespace cve {
|
||||||
class FirstApp {
|
class FirstApp {
|
||||||
@@ -11,5 +12,7 @@ namespace cve {
|
|||||||
void run();
|
void run();
|
||||||
private:
|
private:
|
||||||
CveWindow cveWindow{WIDTH, HEIGHT, "Hello Vulkan!"};
|
CveWindow cveWindow{WIDTH, HEIGHT, "Hello Vulkan!"};
|
||||||
|
CvePipeline cvePipeline{"shaders/simple_shader.vert.spv",
|
||||||
|
"shaders/simple_shader.frag.spv"};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user