fp: Update physics at a fixed rate
This commit is contained in:
+7
-1
@@ -1121,7 +1121,13 @@ void TELY_DLL_FrameUpdate(void *user_data)
|
||||
}
|
||||
}
|
||||
|
||||
FP_Update(platform, game, renderer, input);
|
||||
Dqn_f32 const PHYSICS_STEP = 1 / 60.f;
|
||||
for (game->delta_s_accumulator += input->delta_s;
|
||||
game->delta_s_accumulator > PHYSICS_STEP;
|
||||
game->delta_s_accumulator -= PHYSICS_STEP) {
|
||||
FP_Update(platform, game, renderer, input);
|
||||
}
|
||||
|
||||
FP_Render(game, platform, renderer);
|
||||
|
||||
// NOTE: UI ====================================================================================
|
||||
|
||||
Reference in New Issue
Block a user