From 5b5c13a84e96fe18d4c2887fa750bac53055209a Mon Sep 17 00:00:00 2001 From: Umut Date: Tue, 12 Mar 2024 01:13:45 +0300 Subject: [PATCH] Make `CreateWindowParams` type and `create_windows` system from `bevy_winit` public for manual window creation --- crates/bevy_winit/src/lib.rs | 5 +++-- crates/bevy_winit/src/system.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs index 1e638e1a5eff75..a05644d25b8f14 100644 --- a/crates/bevy_winit/src/lib.rs +++ b/crates/bevy_winit/src/lib.rs @@ -16,11 +16,12 @@ mod winit_windows; use approx::relative_eq; use bevy_a11y::AccessibilityRequested; use bevy_utils::Instant; -use system::{changed_windows, create_windows, despawn_windows, CachedWindow}; +use system::{changed_windows, despawn_windows, CachedWindow}; use winit::dpi::{LogicalSize, PhysicalSize}; pub use winit_config::*; pub use winit_event::*; pub use winit_windows::*; +pub use system::create_windows; use bevy_app::{App, AppExit, Last, Plugin, PluginsState}; use bevy_ecs::event::ManualEventReader; @@ -232,7 +233,7 @@ impl Default for WinitAppRunnerState { } } -type CreateWindowParams<'w, 's, F = ()> = ( +pub type CreateWindowParams<'w, 's, F = ()> = ( Commands<'w, 's>, Query<'w, 's, (Entity, &'static mut Window), F>, EventWriter<'w, WindowCreated>, diff --git a/crates/bevy_winit/src/system.rs b/crates/bevy_winit/src/system.rs index 0000c45369d44d..44bcc43e6c76e0 100644 --- a/crates/bevy_winit/src/system.rs +++ b/crates/bevy_winit/src/system.rs @@ -34,7 +34,7 @@ use crate::{ /// If any of these entities are missing required components, those will be added with their /// default values. #[allow(clippy::too_many_arguments)] -pub(crate) fn create_windows( +pub fn create_windows( event_loop: &EventLoopWindowTarget, ( mut commands,