Skip to content

Commit

Permalink
Make CreateWindowParams type and create_windows system public (#1…
Browse files Browse the repository at this point in the history
…2428)

# 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.
  • Loading branch information
umut-sahin committed Mar 12, 2024
1 parent b1d1077 commit 78c754c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_winit/src/lib.rs
Expand Up @@ -16,7 +16,8 @@ mod winit_windows;
use approx::relative_eq;
use bevy_a11y::AccessibilityRequested;
use bevy_utils::Instant;
use system::{changed_windows, create_windows, despawn_windows, CachedWindow};
pub use system::create_windows;
use system::{changed_windows, despawn_windows, CachedWindow};
use winit::dpi::{LogicalSize, PhysicalSize};
pub use winit_config::*;
pub use winit_event::*;
Expand Down Expand Up @@ -232,7 +233,8 @@ impl Default for WinitAppRunnerState {
}
}

type CreateWindowParams<'w, 's, F = ()> = (
/// The parameters of the [`create_windows`] system.
pub type CreateWindowParams<'w, 's, F = ()> = (
Commands<'w, 's>,
Query<'w, 's, (Entity, &'static mut Window), F>,
EventWriter<'w, WindowCreated>,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_winit/src/system.rs
Expand Up @@ -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<F: QueryFilter + 'static>(
pub fn create_windows<F: QueryFilter + 'static>(
event_loop: &EventLoopWindowTarget<crate::UserEvent>,
(
mut commands,
Expand Down

0 comments on commit 78c754c

Please sign in to comment.