Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float current_time = input_time();
- float step = 1.0f / 60.0f;
- float accumulator = 0.0f;
- while (input_window_opened()) {
- float new_time = input_time();
- float ft = new_time - current_time;
- current_time = new_time;
- accumulator += ft;
- while (accumulator >= step) {
- debug_start_frame();
- player_update(step);
- entities_update(world_active->eh, step);
- ui_update(step);
- if (world_active->space) {
- physics_step(world_active, step);
- }
- accumulator -= step;
- debug_end_frame();
- }
- render();
- input_sleep(0.0000001);
Add Comment
Please, Sign In to add comment