-
-
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
[Merged by Bors] - Fix panic in multiple_windows example #1737
Conversation
@TheRawMeatball you might want to take a look at this; I can't tell if it's reflective of an underlying State bug. |
Why the extra Done state? You should change the |
the |
Also fixes #1709. I looking into fixing that and added a |
Co-authored-by: Jakob Hellermann <[email protected]>
Yeah, 1709 (oops, missed that) explains a little better how I came to add the new The issue is that state transitions seem to be behaving slightly differently since #1424 and the window no longer exists when It's not clear to me if this new behavior is expected, though. Although |
I think the previous impl worked with two states because we made a guarantee that only one "on_update" gets called per frame. This ensured that the stage exited after on_update and allowed the queued window to be created on the next frame. The new state impl allows for multiple on_update calls per frame if a state change is queued up in on_update. This allows the entire state graph traversal (and associated events) to execute within the same frame. I think the changes in this pr are the right call. The only way to improve this would be to somehow allow mid-frame window creation. |
bors r+ |
Fixes #1736 There seemed to be an obvious transcription error where `setup_pipeline` was being called during `on_update` of `AppState::CreateWindow` instead of `AppState::Setup`. However, the example still panicked after fixing that. I'm not sure if there's some intended or unintended change in event processing during state transitions or something, but this PR make the example work again. Cleaned up an unused `Stage` label while I was in there. Please feel free to close this in favor of another approach.
Pull request successfully merged into main. Build succeeded: |
Fixes #1736
There seemed to be an obvious transcription error where
setup_pipeline
was being called duringon_update
ofAppState::CreateWindow
instead ofAppState::Setup
.However, the example still panicked after fixing that.
I'm not sure if there's some intended or unintended change in event processing during state transitions or something, but this PR make the example work again.
Cleaned up an unused
Stage
label while I was in there.Please feel free to close this in favor of another approach.