-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Improve bevy_winit
documentation
#7609
Improve bevy_winit
documentation
#7609
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good to me and clean things up, but this needs to be rebased.
f1a0efb
to
45ac905
Compare
Example |
b664432
to
dfe3bea
Compare
Example |
dfe3bea
to
36c49c1
Compare
Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks good to me. I can't comment on the unsafe part though.
a716fce
to
10a8ea6
Compare
@IceSentry, I changed it back to doing the |
10a8ea6
to
b194c60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, nothing else jumps out at me so LGTM
I'm guessing the addition of the generic Otherwise in this PR I don't understand its purpose, since all the functions of note here are private, and |
Ah, yes, that's correct. I'll change it back though. It's small enough, and it'll be justified then. |
57ac11a
to
4f09919
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understood everything but I finally reviewed it.
Sorry for the delay.
I'm mostly concerned about #7609 (comment).
@@ -244,79 +241,83 @@ struct InputEvents<'w> { | |||
mouse_wheel_input: EventWriter<'w, MouseWheel>, | |||
touch_input: EventWriter<'w, TouchInput>, | |||
ime_input: EventWriter<'w, Ime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick:
Maybe events from bevy_input
should be bellow the ones from bevy_window
?
(with maybe a mention of that in the comments, and the "// device events" could mention more clearly that it's a winit's DeviceEvent
and the other ones are WindowEvents
?)
/// input, or the window being resized) is received or the time limit is reached. | ||
/// The [`App`](bevy_app::App) will update in response to the following, until an | ||
/// [`AppExit`](bevy_app::AppExit) event appears: | ||
/// - enough time has elapsed since the previous update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// - enough time has elapsed since the previous update | |
/// - enough time has elapsed since the previous update, see [`UpdateMode::Reactive::wait`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why link back to Reactive
a second time here when ReactiveLowPower
's wait
field already has its own documentation?
Co-authored-by: Sélène Amanita <134181069+Selene-Amanita@users.noreply.github.com>
# Objective - #7609 broke Android support ``` 8721 8770 I event crates/bevy_winit/src/system.rs:55: Creating new window "App" (0v0) 8721 8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13 ``` ## Solution - Don't create windows on `StartCause::Init` as it's too early
# Objective - bevyengine#7609 broke Android support ``` 8721 8770 I event crates/bevy_winit/src/system.rs:55: Creating new window "App" (0v0) 8721 8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13 ``` ## Solution - Don't create windows on `StartCause::Init` as it's too early
# Objective - bevyengine/bevy#7609 broke Android support ``` 8721 8770 I event crates/bevy_winit/src/system.rs:55: Creating new window "App" (0v0) 8721 8769 I RustStdoutStderr: thread '<unnamed>' panicked at 'Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.', winit-0.28.6/src/platform_impl/android/mod.rs:1058:13 ``` ## Solution - Don't create windows on `StartCause::Init` as it's too early
Redo of #7590 since I messed up my branch.
Objective
Solution
Migration Guide
UpdateMode::Reactive { max_wait: .. }
->UpdateMode::Reactive { wait: .. }
UpdateMode::ReactiveLowPower { max_wait: .. }
->UpdateMode::ReactiveLowPower { wait: .. }