-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.hpp
More file actions
39 lines (31 loc) · 911 Bytes
/
Window.hpp
File metadata and controls
39 lines (31 loc) · 911 Bytes
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
39
#pragma once
#include <SDL2/SDL.h>
#include <SDL2/SDL_vulkan.h>
#include <vulkan/vulkan.hpp>
#include <string>
namespace engine {
class Window
{
public:
Window(int w, int h, std::string name);
~Window();
Window(const Window&) = delete;
Window& operator=(const Window&) = delete;
VkExtent2D getExtent() {
return { static_cast<uint32_t>(width), static_cast<uint32_t>(height) };
};
bool wasWindowResized() { return framebufferResized; };
void resetWindowResizedFlag() { framebufferResized = false; };
void createWindowSurface(VkInstance instance, VkSurfaceKHR* surface);
void recreateWindowSurface(VkInstance instance, VkSurfaceKHR* surface);
bool m_stillRunning{ true };
SDL_Window* window;
void framebufferResizeCallback();
private:
void initWindow();
int width;
int height;
bool framebufferResized = false;
std::string windowName;
};
} //namespace engine