blob: e449e3484e7ce6b44d5dd441e19d1e3177e3c057 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#pragma once
#include <vulkan/vulkan_core.h>
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <string>
namespace xe {
class Window {
public:
Window(int w, int h, std::string name);
~Window();
Window(const Window &) = delete;
Window &operator=(const Window &);
bool shouldClose() { return glfwWindowShouldClose(window); }
VkExtent2D getExtent() { return { static_cast<uint32_t>(width), static_cast<uint32_t>(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;
};
}
|