Guest User

Untitled

a guest
Dec 15th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. float current_time = input_time();
  2. float step = 1.0f / 60.0f;
  3. float accumulator = 0.0f;
  4. while (input_window_opened()) {
  5. float new_time = input_time();
  6. float ft = new_time - current_time;
  7. current_time = new_time;
  8. accumulator += ft;
  9. while (accumulator >= step) {
  10. debug_start_frame();
  11. player_update(step);
  12. entities_update(world_active->eh, step);
  13. ui_update(step);
  14. if (world_active->space) {
  15. physics_step(world_active, step);
  16. }
  17. accumulator -= step;
  18. debug_end_frame();
  19. }
  20. render();
  21. input_sleep(0.0000001);
Add Comment
Please, Sign In to add comment