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

Add an alternative winit runner that can be started when not on the main thread #1063

Merged
merged 1 commit into from
Dec 24, 2020

Conversation

refnil
Copy link
Contributor

@refnil refnil commented Dec 14, 2020

Add a variant of the function winit_runner.
That variant uses EventLoop::new_any_thread instead of the regular EventLoop::new that panic if not executed on the main thread.

My use case is running bevy in a test suite. See #1057 for details.

If you prefer, I could redo this functionality using configuration in WinitConfig. I would add a field to configure if you want the regular event loop, the any thread event loop or a custom event loop.

@Moxinilian Moxinilian added C-Enhancement A new feature A-Windowing Platform-agnostic interface layer to run your app in labels Dec 15, 2020
@cart
Copy link
Member

cart commented Dec 24, 2020

Looks good to me. I'm also down for moving this to WinitConfig, but I'm cool with the current approach as well.

@cart cart merged commit d3d6c35 into bevyengine:master Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Enhancement A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants