diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-19 21:37:30 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-19 21:37:30 +0100 |
commit | e1431633f7eb33041330b8bf01a5954e747c60a1 (patch) | |
tree | f97c92da301bea25ccbd9c93bad6f56fc88c3e79 | |
parent | 838831e13a9c6b3114d4d9ec0417f04dde47b1ac (diff) |
Better document window_set_framerate_limit
-rw-r--r-- | include/mgl/window/window.h | 2 | ||||
-rw-r--r-- | src/window/window.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h index 2ce9a4b..2d1a774 100644 --- a/include/mgl/window/window.h +++ b/include/mgl/window/window.h @@ -71,7 +71,7 @@ bool mgl_window_is_mouse_button_pressed(const mgl_window *self, mgl_mouse_button void mgl_window_close(mgl_window *self); void mgl_window_set_title(mgl_window *self, const char *title); void mgl_window_set_cursor_visible(mgl_window *self, bool visible); -/* 0 = no fps limit */ +/* 0 = no fps limit, or limit fps to vsync if vsync is enabled */ void mgl_window_set_framerate_limit(mgl_window *self, int fps); void mgl_window_set_position(mgl_window *self, mgl_vec2i position); diff --git a/src/window/window.c b/src/window/window.c index 25e3ff2..8ed68e7 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -701,7 +701,7 @@ void mgl_window_display(mgl_window *self) { if(self->frame_time_limit > 0.000001) { double time_left_to_sleep = self->frame_time_limit - mgl_clock_get_elapsed_time_seconds(&self->frame_timer); - if(time_left_to_sleep > 0.0) + if(time_left_to_sleep > 0.000001) usleep(time_left_to_sleep * 1000000.0); mgl_clock_restart(&self->frame_timer); } |