1786007088
This commit is contained in:
@@ -40,7 +40,6 @@ impl<S> Trekstor<S> {
|
||||
|
||||
pub fn update(&mut self, update: UpdateFn<S>) {
|
||||
loop {
|
||||
self.ctx.input.handle_event();
|
||||
self.current_time = Instant::now();
|
||||
let dt = self.current_time - self.last_time;
|
||||
self.last_time = self.current_time;
|
||||
@@ -49,6 +48,7 @@ impl<S> Trekstor<S> {
|
||||
sleep(self.update_timestep - dt);
|
||||
}
|
||||
|
||||
self.ctx.input.handle_event();
|
||||
if !update(&mut self.ctx, &mut self.state) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user