Skip to content

Commit 78c754c

Browse files
authored
Make CreateWindowParams type and create_windows system public (#12428)
# Objective To have a user level workaround for #12237. ## Solution Workaround to the problem is described in: #12237 (comment) ## Changelog ### Changed - `CreateWindowParams` type and `create_windows` system from `bevy_winit` is now public, which allows library authors and game developers to manually trigger window creation when needed.
1 parent b1d1077 commit 78c754c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ mod winit_windows;
1616
use approx::relative_eq;
1717
use bevy_a11y::AccessibilityRequested;
1818
use bevy_utils::Instant;
19-
use system::{changed_windows, create_windows, despawn_windows, CachedWindow};
19+
pub use system::create_windows;
20+
use system::{changed_windows, despawn_windows, CachedWindow};
2021
use winit::dpi::{LogicalSize, PhysicalSize};
2122
pub use winit_config::*;
2223
pub use winit_event::*;
@@ -232,7 +233,8 @@ impl Default for WinitAppRunnerState {
232233
}
233234
}
234235

235-
type CreateWindowParams<'w, 's, F = ()> = (
236+
/// The parameters of the [`create_windows`] system.
237+
pub type CreateWindowParams<'w, 's, F = ()> = (
236238
Commands<'w, 's>,
237239
Query<'w, 's, (Entity, &'static mut Window), F>,
238240
EventWriter<'w, WindowCreated>,

crates/bevy_winit/src/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::{
3434
/// If any of these entities are missing required components, those will be added with their
3535
/// default values.
3636
#[allow(clippy::too_many_arguments)]
37-
pub(crate) fn create_windows<F: QueryFilter + 'static>(
37+
pub fn create_windows<F: QueryFilter + 'static>(
3838
event_loop: &EventLoopWindowTarget<crate::UserEvent>,
3939
(
4040
mut commands,

0 commit comments

Comments
 (0)