aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-08-25 03:06:42 +0200
committerdec05eba <dec05eba@protonmail.com>2023-08-25 10:43:40 +0200
commit30d9f5392fb07105e792963d74786024adc79dd5 (patch)
tree47d21dff4323b03ab738366908f2171ba01a00c4 /tests
parentef4a993d20ceb791ac62dd219ee7d63524e04a3e (diff)
Add monitor events, limit fps to monitor the window is in, reduce latency (glFinish, fps limit)
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/main.c b/tests/main.c
index 2155181..720cf06 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -300,7 +300,9 @@ int main(int argc, char **argv) {
} else if(event.key.code == MGL_KEY_F) {
mgl_window_set_fullscreen(&window, !mgl_window_is_fullscreen(&window));
} else if(event.key.code == MGL_KEY_X) {
- mgl_window_set_vsync_enabled(&window, !mgl_window_is_vsync_enabled(&window));
+ bool enable_vsync = !mgl_window_is_vsync_enabled(&window);
+ mgl_window_set_vsync_enabled(&window, enable_vsync);
+ fprintf(stderr, "vsync %s\n", enable_vsync ? "enabled" : "disabled");
}
fprintf(stderr, "key press event, code: %u\n", event.key.code);
break;