diff --git a/a.out b/a.out index 0af150c..7b85d9f 100755 Binary files a/a.out and b/a.out differ diff --git a/cve_window.cpp b/cve_window.cpp index 5b2d6cd..f0d1c62 100644 --- a/cve_window.cpp +++ b/cve_window.cpp @@ -1,5 +1,7 @@ #include "cve_window.hpp" +#include + namespace cve { CveWindow::CveWindow(int w, int h, std::string name) : width{w}, height{h}, windowName{name} { @@ -19,4 +21,10 @@ namespace cve { window = glfwCreateWindow(width, height, 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"); + } + } } diff --git a/cve_window.hpp b/cve_window.hpp index f522ea2..75afcff 100644 --- a/cve_window.hpp +++ b/cve_window.hpp @@ -15,6 +15,8 @@ class CveWindow { CveWindow &operator=(const CveWindow &) = delete; bool shouldClose() { return glfwWindowShouldClose(window); }; + + void createWindowSurface(VkInstance instance, VkSurfaceKHR *surface); private: void initWindow(); diff --git a/first_app.hpp b/first_app.hpp index e4bab1b..8c14bab 100644 --- a/first_app.hpp +++ b/first_app.hpp @@ -1,6 +1,7 @@ #pragma once #include "cve_window.hpp" +#include "cve_pipeline.hpp" namespace cve { class FirstApp { @@ -11,5 +12,7 @@ namespace cve { void run(); private: CveWindow cveWindow{WIDTH, HEIGHT, "Hello Vulkan!"}; + CvePipeline cvePipeline{"shaders/simple_shader.vert.spv", + "shaders/simple_shader.frag.spv"}; }; }