-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.h
More file actions
78 lines (54 loc) · 1.78 KB
/
Copy pathWindow.h
File metadata and controls
78 lines (54 loc) · 1.78 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include <glad/glad.h>
#include <glfw/glfw3.h>
#include <glfw/glfw3native.h>
#include <string>
namespace DecisionSolver
{
enum WindowState
{
Regular=0,
Borderless,
Fullscreen
};
struct WindowData
{
WindowData(int nWidth = 720, int nHeight = 480, std::string sName = "New Window", WindowState eState = WindowState::Regular) :
width(nWidth), height(nHeight), windowName(sName), windowState(eState) {}
int width, height;
std::string windowName;
WindowState windowState;
};
class Window
{
GLFWwindow* m_pWindow = nullptr;
GLFWmonitor* m_pMonitor = nullptr;
WindowData m_windowData{};
int m_lastX = 0, m_lastY = 0;
bool m_bReady = false;
static unsigned glfwInstances;
void SavePosition();
public:
Window() {}
Window(std::nullptr_t) {}
Window(WindowData& windowData);
Window(int width, int height, std::string name="New Window", WindowState state=WindowState::Regular);
Window(const Window& other) = delete;
~Window();
void Init();
void Init(WindowData& windowData);
void Init(int width, int height, std::string name="New Window", WindowState state=WindowState::Regular);
void Destroy();
Window& operator=(const Window& other) = delete;
void SwitchMode(WindowState state);
GLFWwindow* GetWindow();
void SetTitle(std::string windowName);
void SetSize(int width, int height);
static void PollEvents();
bool Alive();
int GetKeyState(int key);
bool Ready();
static void InitGLFW();
static void TerminateGLFW();
}; // Window
} // DecisionSolver