Guest User

Untitled

a guest
Jun 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. void cpu_save()
  2. {
  3.     static int past, present = ::SDL_GetTicks();
  4.     past = present;
  5.     present = ::SDL_GetTicks();
  6.  
  7.     int wait = FRAME_RATE - (present - past);
  8.  
  9.     cout << wait << endl;
  10.  
  11.     if (wait < 0 || wait > FRAME_RATE) wait = 0;
  12.     ::SDL_Delay(wait);
  13. }
Add Comment
Please, Sign In to add comment