Move Window creation to PreStartup
This commit is contained in:
parent
74b6a118b5
commit
e37a5bcfc7
@ -19,6 +19,7 @@ extern crate alloc;
|
|||||||
|
|
||||||
use alloc::sync::Arc;
|
use alloc::sync::Arc;
|
||||||
|
|
||||||
|
use bevy_ecs::system::Commands;
|
||||||
use bevy_platform::sync::Mutex;
|
use bevy_platform::sync::Mutex;
|
||||||
|
|
||||||
mod event;
|
mod event;
|
||||||
@ -134,10 +135,9 @@ impl Plugin for WindowPlugin {
|
|||||||
.add_event::<AppLifecycle>();
|
.add_event::<AppLifecycle>();
|
||||||
|
|
||||||
if self.spawn_primary_window {
|
if self.spawn_primary_window {
|
||||||
app.world_mut().spawn((
|
app.add_systems(PreStartup, |mut commands: Commands| {
|
||||||
PrimaryWindow,
|
commands.spawn(PrimaryWindow);
|
||||||
RawHandleWrapperHolder(Arc::new(Mutex::new(None))),
|
});
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.exit_condition {
|
match self.exit_condition {
|
||||||
|
Loading…
Reference in New Issue
Block a user