-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVreWindow.hpp
40 lines (33 loc) · 940 Bytes
/
VreWindow.hpp
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
40
#pragma once
#include <SDL2/SDL.h>
#include <SDL2/sdl_vulkan.h>
#include <vulkan/vulkan.h>
#include "VideoSettings.hpp"
namespace vre {
class VreWindow {
public:
VreWindow() {
SDL_Init(SDL_INIT_VIDEO);
SDL_WindowFlags window_flags = (SDL_WindowFlags)(
SDL_WINDOW_VULKAN
| SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
m_window = SDL_CreateWindow(
"Vulkan Engine",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
WINDOW_WIDTH,
WINDOW_HEIGHT,
window_flags
);
}
~VreWindow() {}
VkExtent2D getExtent() { return { WINDOW_WIDTH, WINDOW_HEIGHT }; }
bool wasWindowResized() { return m_framebufferResized; }
void resetWindowResizedFlag() { m_framebufferResized = false; }
static void framebufferResizeCallback(SDL_Window *_window, int _width, int _height) {
//auto window = reinterpret_cast<vre::VreWindow *>()
}
bool m_framebufferResized = false;
SDL_Window *m_window;
};
}