diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-08-25 11:12:55 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-08-25 11:12:55 +0200 |
commit | f273d44d325a50631698865f6b863b4685e0cb2a (patch) | |
tree | 6727fe0ffa714abf647ad3cf86030b3235119736 | |
parent | 99288368ebe3d1f170a102c1dbd4330c6cc92d0a (diff) |
Add missing low latency functions for window
-rw-r--r-- | include/mglpp/window/Window.hpp | 3 | ||||
-rw-r--r-- | src/window/Window.cpp | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp index 2f148e7..c90f89e 100644 --- a/include/mglpp/window/Window.hpp +++ b/include/mglpp/window/Window.hpp @@ -75,6 +75,9 @@ namespace mgl { bool is_vsync_enabled() const; void set_fullscreen(bool fullscreen); bool is_fullscreen() const; + // Enabling low latency may slightly increase cpu usage + void set_low_latency(bool low_latency); + bool is_low_latency_enabled() 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 512991a..d519e2f 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -109,6 +109,14 @@ namespace mgl { return mgl_window_is_fullscreen(&window); } + void Window::set_low_latency(bool low_latency) { + mgl_window_set_low_latency(&window, low_latency); + } + + bool Window::is_low_latency_enabled() const { + return mgl_window_is_low_latency_enabled(&window); + } + void Window::set_key_repeat_enabled(bool enabled) { mgl_window_set_key_repeat_enabled(&window, enabled); } |