From 8045b8ba04aae39a4cf9733e72413f648b6ebe2b Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Sun, 18 Sep 2022 21:20:51 -0400 Subject: stanford dragon rendering --- engine/xe_window.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 engine/xe_window.hpp (limited to 'engine/xe_window.hpp') diff --git a/engine/xe_window.hpp b/engine/xe_window.hpp new file mode 100755 index 0000000..bf80bd7 --- /dev/null +++ b/engine/xe_window.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include +#define GLFW_INCLUDE_VULKAN +#include + +#include +namespace xe { + +class XeWindow { + public: + XeWindow(int w, int h, std::string name); + ~XeWindow(); + + XeWindow(const XeWindow &) = delete; + XeWindow &operator=(const XeWindow &); + + bool shouldClose() { return glfwWindowShouldClose(window); } + VkExtent2D getExtent() { return { static_cast(width), static_cast(height)}; } + bool wasWindowResized() { return frameBufferResized; } + void resetWindowResizedFlag() { frameBufferResized = false; } + GLFWwindow *getGLFWwindow() const { return window; } + + void createWindowSurface(VkInstance instance, VkSurfaceKHR *surface); + + private: + static void framebufferResizeCallback(GLFWwindow *window, int width, int height); + void initWindow(); + + int width; + int height; + bool frameBufferResized = false; + + std::string windowName; + GLFWwindow *window; +}; + +} \ No newline at end of file -- cgit v1.2.3-freya