Hymn to Beauty
C++ 3D Engine
Window.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glm/glm.hpp>
4
5#if ANDROID
6#include <game-activity/native_app_glue/android_native_app_glue.h>
7#else
8struct GLFWwindow;
9#endif
10
11namespace Utility {
12
14class Window {
15 public:
16#if ANDROID
18
21 Window(ANativeWindow* androidWindow);
22#else
24
32 Window(unsigned int width, unsigned int height, bool fullscreen = false, bool borderless = false, const char* title = "", bool noAPI = false);
33#endif
34
36 ~Window();
37
39
44 void SetSize(const glm::uvec2& size);
45
47
50 const glm::uvec2& GetSize() const;
51
53 void Update();
54
56
59 bool ShouldClose() const;
60
62 void CancelClose();
63
65
69 void SetWindowMode(bool fullscreen, bool borderless) const;
70
72
76 void GetWindowMode(bool& fullscreen, bool& borderless) const;
77
78#if ANDROID
80
83 ANativeWindow* GetAndroidWindow();
84#else
86
89 GLFWwindow* GetGLFWWindow();
90#endif
91
92 private:
93 Window(Window& window) = delete;
94
95#if ANDROID
96 ANativeWindow* window;
97#else
98 GLFWwindow* window;
99#endif
100
101 glm::uvec2 size;
102 bool shouldClose = false;
103};
104
105}
Definition: Window.hpp:14
Window(unsigned int width, unsigned int height, bool fullscreen=false, bool borderless=false, const char *title="", bool noAPI=false)
Create new window.
Definition: Window.cpp:31
~Window()
Destructor.
Definition: Window.cpp:64
void SetWindowMode(bool fullscreen, bool borderless) const
Set window mode.
Definition: Window.cpp:99
void Update()
Update.
Definition: Window.cpp:79
bool ShouldClose() const
Get whether the window should close.
Definition: Window.cpp:86
const glm::uvec2 & GetSize() const
Get the size of the window.
Definition: Window.cpp:75
void GetWindowMode(bool &fullscreen, bool &borderless) const
Get window mode.
Definition: Window.cpp:112
void CancelClose()
Cancel the closing of the window.
Definition: Window.cpp:90
GLFWwindow * GetGLFWWindow()
Get the GLFW window.
Definition: Window.cpp:127
void SetSize(const glm::uvec2 &size)
Set the size of the window.
Definition: Window.cpp:71
Definition: ResourceView.hpp:12