aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-01-07 13:37:15 +0100
committerdec05eba <dec05eba@protonmail.com>2023-01-07 13:37:15 +0100
commit45e509ea8d21bf45df09deecc2e5a2f09751667b (patch)
tree93432ee6eca55ee70525a411ce669a02d32ee63d
parent5c002784679ede545977ef641db34d905f0249e3 (diff)
Window: add functions to set fullscreen state, vsync state
m---------depends/mgl0
-rw-r--r--include/mglpp/window/Window.hpp4
-rw-r--r--src/window/Window.cpp16
3 files changed, 20 insertions, 0 deletions
diff --git a/depends/mgl b/depends/mgl
-Subproject eb7bb70749079490da090a5ad01fd4546195378
+Subproject c6017539ea7caa1db88040f96b3352f15f7b02b
diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp
index b4975b4..2ba61ff 100644
--- a/include/mglpp/window/Window.hpp
+++ b/include/mglpp/window/Window.hpp
@@ -70,6 +70,10 @@ namespace mgl {
void set_title(const char *title);
// 0 = no fps limit, or limit fps to vsync if vsync is enabled
void set_framerate_limit(unsigned int fps);
+ void set_vsync_enabled(bool enabled);
+ bool is_vsync_enabled() const;
+ void set_fullscreen(bool fullscreen);
+ bool is_fullscreen() const;
void set_key_repeat_enabled(bool enabled);
void set_cursor_visible(bool visible);
vec2i get_size() const;
diff --git a/src/window/Window.cpp b/src/window/Window.cpp
index 64ee9fe..512991a 100644
--- a/src/window/Window.cpp
+++ b/src/window/Window.cpp
@@ -93,6 +93,22 @@ namespace mgl {
mgl_window_set_framerate_limit(&window, fps);
}
+ void Window::set_vsync_enabled(bool enabled) {
+ mgl_window_set_vsync_enabled(&window, enabled);
+ }
+
+ bool Window::is_vsync_enabled() const {
+ return mgl_window_is_vsync_enabled(&window);
+ }
+
+ void Window::set_fullscreen(bool fullscreen) {
+ mgl_window_set_fullscreen(&window, fullscreen);
+ }
+
+ bool Window::is_fullscreen() const {
+ return mgl_window_is_fullscreen(&window);
+ }
+
void Window::set_key_repeat_enabled(bool enabled) {
mgl_window_set_key_repeat_enabled(&window, enabled);
}