anvil: send frame callback before blocking to draw on winit
This commit is contained in:
parent
5421b9675c
commit
d3429fa37d
|
@ -98,6 +98,13 @@ pub fn run_winit(
|
||||||
.dispatch_new_events(|event, _| state.process_input_event(event))
|
.dispatch_new_events(|event, _| state.process_input_event(event))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// Send frame events so that client start drawing their next frame
|
||||||
|
state
|
||||||
|
.window_map
|
||||||
|
.borrow()
|
||||||
|
.send_frames(start_time.elapsed().as_millis() as u32);
|
||||||
|
display.borrow_mut().flush_clients(&mut state);
|
||||||
|
|
||||||
// drawing logic
|
// drawing logic
|
||||||
{
|
{
|
||||||
use glium::Surface;
|
use glium::Surface;
|
||||||
|
@ -140,13 +147,7 @@ pub fn run_winit(
|
||||||
error!(log, "Error during rendering: {:?}", err);
|
error!(log, "Error during rendering: {:?}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Send frame events so that client start drawing their next frame
|
|
||||||
state
|
|
||||||
.window_map
|
|
||||||
.borrow()
|
|
||||||
.send_frames(start_time.elapsed().as_millis() as u32);
|
|
||||||
display.borrow_mut().flush_clients(&mut state);
|
|
||||||
|
|
||||||
if event_loop
|
if event_loop
|
||||||
.dispatch(Some(Duration::from_millis(16)), &mut state)
|
.dispatch(Some(Duration::from_millis(16)), &mut state)
|
||||||
.is_err()
|
.is_err()
|
||||||
|
|
Loading…
Reference in New Issue