diff --git a/src/pc/gfx/gfx_sdl2.c b/src/pc/gfx/gfx_sdl2.c index 65d7b4e..923d264 100644 --- a/src/pc/gfx/gfx_sdl2.c +++ b/src/pc/gfx/gfx_sdl2.c @@ -274,13 +274,14 @@ static bool gfx_sdl_start_frame(void) { static void sync_framerate_with_timer(void) { // Number of milliseconds a frame should take (30 fps) - const Uint32 FRAME_TIME = 1000 / 30; - static Uint32 last_time; - Uint32 elapsed = SDL_GetTicks() - last_time; + const Uint64 FRAME_TIME = 1000 / 30; + static Uint64 last_time; + Uint64 elapsed = SDL_GetTicks64() - last_time; if (elapsed < FRAME_TIME) SDL_Delay(FRAME_TIME - elapsed); - last_time += FRAME_TIME; + + last_time = SDL_GetTicks64(); } static void gfx_sdl_swap_buffers_begin(void) {