From d3749a98f88b560050845df666fdd580adbbec40 Mon Sep 17 00:00:00 2001 From: Tobenaii Date: Sat, 18 Dec 2021 00:29:36 +0000 Subject: [PATCH] Use updated window size in bevymark example (#3335) # Objective Have the bird spawning/collision systems in bevymark use the proper window size, instead of the size set in WindowDescriptor which isn't updated when the window is resized. ## Solution Use the Windows resource to grab the width/height from the primary window. This is consistent with the other examples. --- examples/tools/bevymark.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/tools/bevymark.rs b/examples/tools/bevymark.rs index adbaf67469..ac3c975438 100644 --- a/examples/tools/bevymark.rs +++ b/examples/tools/bevymark.rs @@ -50,7 +50,7 @@ struct BirdTexture(Handle); fn setup( mut commands: Commands, - window: Res, + windows: Res, mut counter: ResMut, asset_server: Res, ) { @@ -61,7 +61,7 @@ fn setup( { spawn_birds( &mut commands, - &window, + &windows, &mut counter, initial_count, texture.clone_weak(), @@ -126,7 +126,7 @@ fn mouse_handler( mut commands: Commands, time: Res