diff --git a/src/main.rs b/src/main.rs index fd48ccc..4980190 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,11 +77,21 @@ fn setup( fn handle_input( keyboard_input: Res>, mut settings: ResMut, - mut app_exit_events: ResMut> + mut app_exit_events: ResMut>, + mut windows: Query<&mut Window, With>, ) { if keyboard_input.pressed(settings.key_exit) { app_exit_events.send(bevy::app::AppExit); } + if keyboard_input.just_pressed(settings.key_fullscreen) { + for mut window in &mut windows { + window.mode = if window.mode == WindowMode::Windowed { + WindowMode::BorderlessFullscreen + } else { + WindowMode::Windowed + } + } + } if keyboard_input.just_pressed(settings.key_restart) { settings.reset(); }