File tree 19 files changed +300
-247
lines changed
19 files changed +300
-247
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,10 @@ path = "examples/app/return_after_run.rs"
249
249
name = " thread_pool_resources"
250
250
path = " examples/app/thread_pool_resources.rs"
251
251
252
+ [[example ]]
253
+ name = " headless_defaults"
254
+ path = " examples/app/headless_defaults.rs"
255
+
252
256
[[example ]]
253
257
name = " without_winit"
254
258
path = " examples/app/without_winit.rs"
Original file line number Diff line number Diff line change @@ -95,7 +95,11 @@ impl Plugin for CorePipelinePlugin {
95
95
fn build ( & self , app : & mut App ) {
96
96
app. init_resource :: < ClearColor > ( ) ;
97
97
98
- let render_app = app. sub_app_mut ( RenderApp ) ;
98
+ let render_app = match app. get_sub_app_mut ( RenderApp ) {
99
+ Ok ( render_app) => render_app,
100
+ Err ( _) => return ,
101
+ } ;
102
+
99
103
render_app
100
104
. init_resource :: < DrawFunctions < Transparent2d > > ( )
101
105
. init_resource :: < DrawFunctions < Opaque3d > > ( )
Original file line number Diff line number Diff line change @@ -138,7 +138,11 @@ impl Plugin for PbrPlugin {
138
138
} ,
139
139
) ;
140
140
141
- let render_app = app. sub_app_mut ( RenderApp ) ;
141
+ let render_app = match app. get_sub_app_mut ( RenderApp ) {
142
+ Ok ( render_app) => render_app,
143
+ Err ( _) => return ,
144
+ } ;
145
+
142
146
render_app
143
147
. add_system_to_stage (
144
148
RenderStage :: Extract ,
Original file line number Diff line number Diff line change @@ -53,11 +53,13 @@ impl Plugin for MeshRenderPlugin {
53
53
54
54
app. add_plugin ( UniformComponentPlugin :: < MeshUniform > :: default ( ) ) ;
55
55
56
- app. sub_app_mut ( RenderApp )
57
- . init_resource :: < MeshPipeline > ( )
58
- . add_system_to_stage ( RenderStage :: Extract , extract_meshes)
59
- . add_system_to_stage ( RenderStage :: Queue , queue_mesh_bind_group)
60
- . add_system_to_stage ( RenderStage :: Queue , queue_mesh_view_bind_groups) ;
56
+ if let Ok ( render_app) = app. get_sub_app_mut ( RenderApp ) {
57
+ render_app
58
+ . init_resource :: < MeshPipeline > ( )
59
+ . add_system_to_stage ( RenderStage :: Extract , extract_meshes)
60
+ . add_system_to_stage ( RenderStage :: Queue , queue_mesh_bind_group)
61
+ . add_system_to_stage ( RenderStage :: Queue , queue_mesh_view_bind_groups) ;
62
+ }
61
63
}
62
64
}
63
65
Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ impl Plugin for WireframePlugin {
31
31
32
32
app. init_resource :: < WireframeConfig > ( ) ;
33
33
34
- app. sub_app_mut ( RenderApp )
35
- . add_render_command :: < Opaque3d , DrawWireframes > ( )
36
- . init_resource :: < WireframePipeline > ( )
37
- . init_resource :: < SpecializedPipelines < WireframePipeline > > ( )
38
- . add_system_to_stage ( RenderStage :: Extract , extract_wireframes)
39
- . add_system_to_stage ( RenderStage :: Extract , extract_wireframe_config)
40
- . add_system_to_stage ( RenderStage :: Queue , queue_wireframes) ;
34
+ if let Ok ( render_app) = app. get_sub_app_mut ( RenderApp ) {
35
+ render_app
36
+ . add_render_command :: < Opaque3d , DrawWireframes > ( )
37
+ . init_resource :: < WireframePipeline > ( )
38
+ . init_resource :: < SpecializedPipelines < WireframePipeline > > ( )
39
+ . add_system_to_stage ( RenderStage :: Extract , extract_wireframes)
40
+ . add_system_to_stage ( RenderStage :: Extract , extract_wireframe_config)
41
+ . add_system_to_stage ( RenderStage :: Queue , queue_wireframes) ;
42
+ }
41
43
}
42
44
}
43
45
Original file line number Diff line number Diff line change @@ -53,9 +53,11 @@ impl Plugin for CameraPlugin {
53
53
CoreStage :: PostUpdate ,
54
54
crate :: camera:: camera_system :: < PerspectiveProjection > ,
55
55
) ;
56
- app. sub_app_mut ( RenderApp )
57
- . init_resource :: < ExtractedCameraNames > ( )
58
- . add_system_to_stage ( RenderStage :: Extract , extract_cameras) ;
56
+ if let Ok ( render_app) = app. get_sub_app_mut ( RenderApp ) {
57
+ render_app
58
+ . init_resource :: < ExtractedCameraNames > ( )
59
+ . add_system_to_stage ( RenderStage :: Extract , extract_cameras) ;
60
+ }
59
61
}
60
62
}
61
63
You can’t perform that action at this time.
0 commit comments