Advertisement
Tkap1

Untitled

Nov 22nd, 2024
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1.  
  2. constexpr float c_updates_per_second = 30;
  3. constexpr float c_update_delay = 1.0f / c_updates_per_second;
  4. if(!paused) {
  5.     time += delta;
  6. }
  7. while(time >= c_update_delay) {
  8.     time -= c_update_delay;
  9.     update();
  10. }
  11. float interp_dt = time / c_update_delay;
  12. render(interp_dt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement