@ -119,6 +119,7 @@ fn with_event_loop<R>(
} )
} )
}
}
#[ cfg(not(target_os = " ios " )) ]
fn run_and_return (
fn run_and_return (
event_loop : & mut EventLoop < UserEvent > ,
event_loop : & mut EventLoop < UserEvent > ,
mut winit_app : impl WinitApp ,
mut winit_app : impl WinitApp ,
@ -332,6 +333,11 @@ fn run_and_exit(event_loop: EventLoop<UserEvent>, mut winit_app: impl WinitApp +
next_repaint_time = extremely_far_future ( ) ;
next_repaint_time = extremely_far_future ( ) ;
ControlFlow ::Poll
ControlFlow ::Poll
} else {
} else {
// WaitUntil seems to not work on iOS
#[ cfg(target_os = " ios " ) ]
if let Some ( window ) = winit_app . window ( ) {
window . request_redraw ( ) ;
}
ControlFlow ::WaitUntil ( next_repaint_time )
ControlFlow ::WaitUntil ( next_repaint_time )
} ;
} ;
} )
} )
@ -1052,6 +1058,7 @@ mod glow_integration {
mut native_options : epi ::NativeOptions ,
mut native_options : epi ::NativeOptions ,
app_creator : epi ::AppCreator ,
app_creator : epi ::AppCreator ,
) -> Result < ( ) > {
) -> Result < ( ) > {
#[ cfg(not(target_os = " ios " )) ]
if native_options . run_and_return {
if native_options . run_and_return {
with_event_loop ( native_options , | event_loop , native_options | {
with_event_loop ( native_options , | event_loop , native_options | {
let glow_eframe =
let glow_eframe =
@ -1063,6 +1070,13 @@ mod glow_integration {
let glow_eframe = GlowWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
let glow_eframe = GlowWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
run_and_exit ( event_loop , glow_eframe ) ;
run_and_exit ( event_loop , glow_eframe ) ;
}
}
#[ cfg(target_os = " ios " ) ]
{
let event_loop = create_event_loop_builder ( & mut native_options ) . build ( ) ;
let glow_eframe = GlowWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
run_and_exit ( event_loop , glow_eframe ) ;
}
}
}
}
}
@ -1490,6 +1504,7 @@ mod wgpu_integration {
mut native_options : epi ::NativeOptions ,
mut native_options : epi ::NativeOptions ,
app_creator : epi ::AppCreator ,
app_creator : epi ::AppCreator ,
) -> Result < ( ) > {
) -> Result < ( ) > {
#[ cfg(not(target_os = " ios " )) ]
if native_options . run_and_return {
if native_options . run_and_return {
with_event_loop ( native_options , | event_loop , native_options | {
with_event_loop ( native_options , | event_loop , native_options | {
let wgpu_eframe =
let wgpu_eframe =
@ -1501,6 +1516,13 @@ mod wgpu_integration {
let wgpu_eframe = WgpuWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
let wgpu_eframe = WgpuWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
run_and_exit ( event_loop , wgpu_eframe ) ;
run_and_exit ( event_loop , wgpu_eframe ) ;
}
}
#[ cfg(target_os = " ios " ) ]
{
let event_loop = create_event_loop_builder ( & mut native_options ) . build ( ) ;
let wgpu_eframe = WgpuWinitApp ::new ( & event_loop , app_name , native_options , app_creator ) ;
run_and_exit ( event_loop , wgpu_eframe ) ;
}
}
}
}
}