-
Notifications
You must be signed in to change notification settings - Fork 21
Bevy 0.16 support, and fixed blinking text and ability to request redraws #35
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
base: master
Are you sure you want to change the base?
Conversation
… it was not in use.
…n, and fixed blinking text.
…nking the caret/text cursor. Also added support for detecting when the window is focused/unfocused.
…r to fix the failing styling of widgets. This is necessary because this is used by some widgets to update its per-frame state based on external state (like time). Also added a `SystemSet` to help the users ensure that the update step happens before the view step.
|
I updated to the recent iced commits, which had some changes to the renderer: Azorlogh@3dc8f84 |
Thank you! Now I have updated this PR to include your recent changes. |
|
Hey, thanks for this PR and sorry it's taken me so long to address this. So far, I've had a policy of only having versions on master that use iced and bevy versions published on Crates.io, but for the past several versions that hasn't been possible, so I'm now reconsidering my policy.
What additional changes are in the fork of iced? Ideally, any changes that need to be done to iced are made into pull requests against the iced repo. |
No problem! We're just starting to use bevy_iced at work, so I expect to find a few more things that don't currently work that have to be fixed as we start using more iced features. We can contribute with fixes for these things. I sent you an e-mail earlier regarding this. Did you get it? Since bevy is keeping its wgpu dependency up to date new versions of bevy will not work with an old version of iced. So until the day comes where iced reaches 1.0 and starts releasing versions keeping its wgpu dependency up to date, I think we have mainly two choices. Either the users must depend on the git version of bevy_iced, or we need to get the main branch of iced published to crates.io a bit more often in some way or another.
This is the fork in question: https://github.com/Argeo-Robotics/iced/tree/bevy-0.16-support I've opened a thread in Discourse to get feedback on how to solve this. Ideally I think Iced should support pipelined rendering so that new code doesn't break bevy_iced in the future. There have been no replies to the thread yet, so I don't know how long it will take to get the fork merged back into iced. I have submitted a PR for it: maybe it's trivial enough that it gets accepted. But still, unless iced accepts pipelined rendering support as a feature of iced, a future change may once again break bevy_iced, so it would be good to have a discussion with iced about this. |
98113ec to
38d4ff6
Compare
This is the continuation of the work in
It updates the plugin to work with Bevy 0.16 (currently rc.3) and the current main branch of Iced. It also solves the following issues:
TextInputIt is blocked by
iced_wgpu::Renderermanually finish/recall the staging belt iced-rs/iced#2693ParagraphandEditorin the renderer iced-rs/iced#2886Since there is no stable release of Iced with a version of wgpu that matches the version required by Bevy 0.16 this PR needs to point to a git commit for its Iced dependency.
The main change in this PR is how the loop is set up. Before this PR my understanding is that the flow would be like this (dots represent random order on runtime):
Widgets implement text caching so that for instance the
TextInputwill now show letters that are typed for about one frame, before it disappears because the next frame is based on old state. This motivated the following new flow:RedrawRequestedevent so that the widgets are ready for drawing.Number 6 is a new step, and is required for a lot of logic happening in the widgets. This fixed the broken styling of widgets, as well as missing animations (e.g. blinking caret). In addition, to support
WinitSettings::desktop_app()aRequestRedrawevent is now scheduled for triggering as specified by Iced. To do this an async task is scheduled using either Tokio or async-io (smol), or using gloo-timers on the web.