@@ -119,6 +119,7 @@ fn with_event_loop<R>(
119
119
} )
120
120
}
121
121
122
+ #[ cfg( not( target_os = "ios" ) ) ]
122
123
fn run_and_return (
123
124
event_loop : & mut EventLoop < UserEvent > ,
124
125
mut winit_app : impl WinitApp ,
@@ -332,6 +333,11 @@ fn run_and_exit(event_loop: EventLoop<UserEvent>, mut winit_app: impl WinitApp +
332
333
next_repaint_time = extremely_far_future ( ) ;
333
334
ControlFlow :: Poll
334
335
} else {
336
+ // WaitUntil seems to not work on iOS
337
+ #[ cfg( target_os = "ios" ) ]
338
+ if let Some ( window) = winit_app. window ( ) {
339
+ window. request_redraw ( ) ;
340
+ }
335
341
ControlFlow :: WaitUntil ( next_repaint_time)
336
342
} ;
337
343
} )
@@ -1052,6 +1058,7 @@ mod glow_integration {
1052
1058
mut native_options : epi:: NativeOptions ,
1053
1059
app_creator : epi:: AppCreator ,
1054
1060
) -> Result < ( ) > {
1061
+ #[ cfg( not( target_os = "ios" ) ) ]
1055
1062
if native_options. run_and_return {
1056
1063
with_event_loop ( native_options, |event_loop, native_options| {
1057
1064
let glow_eframe =
@@ -1063,6 +1070,13 @@ mod glow_integration {
1063
1070
let glow_eframe = GlowWinitApp :: new ( & event_loop, app_name, native_options, app_creator) ;
1064
1071
run_and_exit ( event_loop, glow_eframe) ;
1065
1072
}
1073
+
1074
+ #[ cfg( target_os = "ios" ) ]
1075
+ {
1076
+ let event_loop = create_event_loop_builder ( & mut native_options) . build ( ) ;
1077
+ let glow_eframe = GlowWinitApp :: new ( & event_loop, app_name, native_options, app_creator) ;
1078
+ run_and_exit ( event_loop, glow_eframe) ;
1079
+ }
1066
1080
}
1067
1081
}
1068
1082
@@ -1490,6 +1504,7 @@ mod wgpu_integration {
1490
1504
mut native_options : epi:: NativeOptions ,
1491
1505
app_creator : epi:: AppCreator ,
1492
1506
) -> Result < ( ) > {
1507
+ #[ cfg( not( target_os = "ios" ) ) ]
1493
1508
if native_options. run_and_return {
1494
1509
with_event_loop ( native_options, |event_loop, native_options| {
1495
1510
let wgpu_eframe =
@@ -1501,6 +1516,13 @@ mod wgpu_integration {
1501
1516
let wgpu_eframe = WgpuWinitApp :: new ( & event_loop, app_name, native_options, app_creator) ;
1502
1517
run_and_exit ( event_loop, wgpu_eframe) ;
1503
1518
}
1519
+
1520
+ #[ cfg( target_os = "ios" ) ]
1521
+ {
1522
+ let event_loop = create_event_loop_builder ( & mut native_options) . build ( ) ;
1523
+ let wgpu_eframe = WgpuWinitApp :: new ( & event_loop, app_name, native_options, app_creator) ;
1524
+ run_and_exit ( event_loop, wgpu_eframe) ;
1525
+ }
1504
1526
}
1505
1527
}
1506
1528
0 commit comments