@@ -222,6 +222,8 @@ fn setup(
222222 quad : meshes
223223 . add ( Rectangle :: from_size ( Vec2 :: splat ( BIRD_TEXTURE_SIZE as f32 ) ) )
224224 . into ( ) ,
225+ // We're seeding the PRNG here to make this example deterministic for testing purposes.
226+ // This isn't strictly required in practical use unless you need your app to be deterministic.
225227 color_rng : ChaCha8Rng :: seed_from_u64 ( 42 ) ,
226228 material_rng : ChaCha8Rng :: seed_from_u64 ( 42 ) ,
227229 velocity_rng : ChaCha8Rng :: seed_from_u64 ( 42 ) ,
@@ -305,6 +307,8 @@ fn mouse_handler(
305307 mut wave : Local < usize > ,
306308) {
307309 if rng. is_none ( ) {
310+ // We're seeding the PRNG here to make this example deterministic for testing purposes.
311+ // This isn't strictly required in practical use unless you need your app to be deterministic.
308312 * rng = Some ( ChaCha8Rng :: seed_from_u64 ( 42 ) ) ;
309313 }
310314 let rng = rng. as_mut ( ) . unwrap ( ) ;
@@ -538,6 +542,8 @@ fn counter_system(
538542}
539543
540544fn init_textures ( textures : & mut Vec < Handle < Image > > , args : & Args , images : & mut Assets < Image > ) {
545+ // We're seeding the PRNG here to make this example deterministic for testing purposes.
546+ // This isn't strictly required in practical use unless you need your app to be deterministic.
541547 let mut color_rng = ChaCha8Rng :: seed_from_u64 ( 42 ) ;
542548 while textures. len ( ) < args. material_texture_count {
543549 let pixel = [ color_rng. gen ( ) , color_rng. gen ( ) , color_rng. gen ( ) , 255 ] ;
@@ -573,6 +579,8 @@ fn init_materials(
573579 texture : textures. first ( ) . cloned ( ) ,
574580 } ) ) ;
575581
582+ // We're seeding the PRNG here to make this example deterministic for testing purposes.
583+ // This isn't strictly required in practical use unless you need your app to be deterministic.
576584 let mut color_rng = ChaCha8Rng :: seed_from_u64 ( 42 ) ;
577585 let mut texture_rng = ChaCha8Rng :: seed_from_u64 ( 42 ) ;
578586 materials. extend (
0 commit comments