@@ -29,11 +29,8 @@ pub struct PixelsResource {
29
29
pub window : Entity ,
30
30
}
31
31
32
- // Internal configuration resource for use in `setup` system. Users should set values on
33
- // `PixelsPlugin` instead of inserting this resource directly. Ideally we just read the plugin
34
- // configuration directly within `setup` system, but this is not currently possible.
35
32
#[ derive( Resource ) ]
36
- pub struct PixelsOptions {
33
+ struct PixelsOptions {
37
34
width : u32 ,
38
35
height : u32 ,
39
36
}
@@ -76,7 +73,7 @@ impl PixelsPlugin {
76
73
pub const RENDER_TIME : DiagnosticId =
77
74
DiagnosticId :: from_u128 ( 1187582084072339577959028643519383692 ) ;
78
75
79
- pub fn setup (
76
+ fn setup (
80
77
mut commands : Commands ,
81
78
mut diagnostics : ResMut < Diagnostics > ,
82
79
options : Res < PixelsOptions > ,
@@ -111,7 +108,7 @@ impl PixelsPlugin {
111
108
commands. insert_resource ( PixelsResource { pixels, window } ) ;
112
109
}
113
110
114
- pub fn window_resize (
111
+ fn window_resize (
115
112
mut window_resized_events : EventReader < WindowResized > ,
116
113
mut resource : ResMut < PixelsResource > ,
117
114
windows : Query < & Window > ,
@@ -125,7 +122,7 @@ impl PixelsPlugin {
125
122
}
126
123
}
127
124
128
- pub fn window_change (
125
+ fn window_change (
129
126
mut window_backend_scale_factor_changed_events : EventReader <
130
127
WindowBackendScaleFactorChanged ,
131
128
> ,
@@ -148,7 +145,7 @@ impl PixelsPlugin {
148
145
}
149
146
150
147
#[ cfg( not( target_arch = "wasm32" ) ) ]
151
- pub fn render ( resource : Res < PixelsResource > , mut diagnostics : ResMut < Diagnostics > ) {
148
+ fn render ( resource : Res < PixelsResource > , mut diagnostics : ResMut < Diagnostics > ) {
152
149
let start = Instant :: now ( ) ;
153
150
154
151
resource. pixels . render ( ) . expect ( "failed to render pixels" ) ;
@@ -159,7 +156,7 @@ impl PixelsPlugin {
159
156
}
160
157
161
158
#[ cfg( target_arch = "wasm32" ) ]
162
- pub fn render ( resource : Res < PixelsResource > ) {
159
+ fn render ( resource : Res < PixelsResource > ) {
163
160
resource. pixels . render ( ) . expect ( "failed to render pixels" ) ;
164
161
}
165
162
}
0 commit comments