Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constexpr float c_updates_per_second = 30;
- constexpr float c_update_delay = 1.0f / c_updates_per_second;
- if(!paused) {
- time += delta;
- }
- while(time >= c_update_delay) {
- time -= c_update_delay;
- update();
- }
- float interp_dt = time / c_update_delay;
- render(interp_dt);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement