Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhitman committed Jun 16, 2024
1 parent 24ec7ed commit 42bf617
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tulip/linux/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,12 @@ int main(int argc, char **argv) {
while(c>=0) {
// unix_display_draw returns -1 if the window was quit
c = unix_display_draw();
if(c>=0) {
// Figure out how long to sleep. ticks has the amount of time already spent for this frame
// so let's fill in the rest with a usleep.
int sleep_ms_for_frame = (int) ((1000.0/TARGET_DESKTOP_FPS) - ticks);
if(sleep_ms_for_frame > 0) usleep(1000*sleep_ms_for_frame);
}
}
if(c==-2) {
// signal to restart display after a timing change
Expand Down

0 comments on commit 42bf617

Please sign in to comment.