|
|
@ -171,11 +171,17 @@ pub fn ui_loop() {
|
|
|
|
let frame_start = Instant::now();
|
|
|
|
let frame_start = Instant::now();
|
|
|
|
|
|
|
|
|
|
|
|
if REDRAW_SCHEDULER.should_draw() {
|
|
|
|
if REDRAW_SCHEDULER.should_draw() {
|
|
|
|
|
|
|
|
if let Err(err) = panic::catch_unwind(|| {
|
|
|
|
skulpin_renderer.draw(&window, |canvas, coordinate_system_helper| {
|
|
|
|
skulpin_renderer.draw(&window, |canvas, coordinate_system_helper| {
|
|
|
|
if renderer.draw(canvas, coordinate_system_helper) {
|
|
|
|
if renderer.draw(canvas, coordinate_system_helper) {
|
|
|
|
handle_new_grid_size(window.inner_size(), &renderer)
|
|
|
|
handle_new_grid_size(window.inner_size(), &renderer)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).ok();
|
|
|
|
}).ok();
|
|
|
|
|
|
|
|
}) {
|
|
|
|
|
|
|
|
println!("Render failed. Closing app");
|
|
|
|
|
|
|
|
*control_flow = ControlFlow::Exit;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
*control_flow = ControlFlow::WaitUntil(frame_start + Duration::from_secs_f32(1.0 / 60.0));
|
|
|
|
*control_flow = ControlFlow::WaitUntil(frame_start + Duration::from_secs_f32(1.0 / 60.0));
|
|
|
|