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