Skip to content

Commit

Permalink
Handle giving time input to egui correctly (#226)
Browse files Browse the repository at this point in the history
The predicted_dt should be based on the target framerate and not depend on frame-to-frame fluctuations. Instead, we can pass total elapsed time instead to let egui handle things correctly.
  • Loading branch information
TheRawMeatball authored Dec 11, 2023
1 parent c0f10d2 commit e4461a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub fn process_input_system(
}

for mut context in context_params.contexts.iter_mut() {
context.egui_input.predicted_dt = time.delta_seconds();
context.egui_input.time = Some(time.elapsed_seconds_f64());
}

// In some cases, we may skip certain events. For example, we ignore `ReceivedCharacter` events
Expand Down

0 comments on commit e4461a4

Please sign in to comment.