Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,9 @@ static void draw_screen()
// Output to screen
SDL_RenderPresent(renderer);
if (!config.vsync) {
Uint32 sleep_time = refresh_period - (SDL_GetTicks() - ticks.main);
if (sleep_time > 0)
SDL_Delay(sleep_time);
Uint32 elapsed = SDL_GetTicks() - ticks.main;
if (elapsed < refresh_period)
SDL_Delay(refresh_period - elapsed);
}
}

Expand Down