aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-08-25 10:53:20 +0200
committerdec05eba <dec05eba@protonmail.com>2023-08-25 10:53:20 +0200
commita6c350cd014fc57cefc4beb6698ac80781ca028c (patch)
tree80daf2495b56f3e65387c80a96e72a8289430c3e /src/window
parent30d9f5392fb07105e792963d74786024adc79dd5 (diff)
Only limit fps to monitor if vsync is enabled
Diffstat (limited to 'src/window')
-rw-r--r--src/window/window.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/window/window.c b/src/window/window.c
index 8035239..d0c9cc0 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -1198,7 +1198,7 @@ void mgl_window_display(mgl_window *self) {
if(time_left_to_sleep > 0.000001)
usleep(time_left_to_sleep * 1000000.0);
mgl_clock_restart(&self->frame_timer);
- } else if(self->frame_time_limit_monitor >= 0.000001) {
+ } else if(self->vsync_enabled && self->frame_time_limit_monitor > 0.000001) {
double time_left_to_sleep = self->frame_time_limit_monitor - mgl_clock_get_elapsed_time_seconds(&self->frame_timer);
if(time_left_to_sleep > 0.000001)
usleep(time_left_to_sleep * 1000000.0);