Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create winit windows before app.initialize() #916

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ pub fn winit_runner(mut app: App) {

app.resources.insert_thread_local(event_loop.create_proxy());

// Create Windows and WinitWindows resources, so startup systems
// in below app.initialize() have access to them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd take out "in below app.initialize()" but that's not a big deal.

// Create Windows and WinitWindows resources so
// startup systems have access to them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal of this mention is so one do not move the call below app.initialize() as this would render it useless.

handle_create_window_events(
&mut app.resources,
&event_loop,
&mut create_window_event_reader,
);

app.initialize();

trace!("Entering winit event loop");
Expand Down