jGL
Loading...
Searching...
No Matches
surface.h
Go to the documentation of this file.
1#ifndef SURFACE
2#define SURFACE
3
4#define GLFW_INCLUDE_VULKAN
5#include <GLFW/glfw3.h>
6
7#include <exception>
8
9namespace jGL::Vulkan
10{
11 class Surface
12 {
13
14 public:
15
16 Surface() = default;
17
18 Surface(const VkInstance & instance, GLFWwindow * window)
19 {
20 if (glfwCreateWindowSurface(instance, window, nullptr, &surface) != VK_SUCCESS)
21 {
22 throw std::runtime_error("Failed to create window surface");
23 }
24 }
25
26 const VkSurfaceKHR & getVkSurfaceKHR(){ return surface; }
27
28 private:
29
30 VkSurfaceKHR surface;
31 };
32}
33
34#endif /* SURFACE */
Definition surface.h:12
Surface(const VkInstance &instance, GLFWwindow *window)
Definition surface.h:18
const VkSurfaceKHR & getVkSurfaceKHR()
Definition surface.h:26
Definition buffer.h:10