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

Bevy 0.7 #79

Merged
merged 8 commits into from
Apr 16, 2022
Merged

Bevy 0.7 #79

merged 8 commits into from
Apr 16, 2022

Conversation

aevyrie
Copy link
Contributor

@aevyrie aevyrie commented Mar 8, 2022

This is based on #78 for egui 0.17. If that is merged, I will rebase on main.

This branch will be used to track bevy/main until the next release.

The biggest upgrade is support for low power mode in bevy (bevyengine/bevy#3974). I've added a few lines to process_output that checks if egui has reported needs_repaint, and sends a bevy RequestRedraw event. I've also updated the examples to use the new WinitSettings::desktop_app() mode for reactive rendering.

This means bevy_egui apps can now use zero resources unless the user is providing input, or there is an egui animation in progress!

image

@aevyrie aevyrie changed the title Tracking bevy/main Bevy 0.7 Apr 15, 2022
@aevyrie
Copy link
Contributor Author

aevyrie commented Apr 15, 2022

@forbjok I merged your branch here to get the two_window example working. This branch has some additional integrations to work with the new low power mode in 0.7.

Cargo.toml Outdated Show resolved Hide resolved
use bevy_egui::{egui, EguiContext, EguiPlugin};

fn main() {
App::new()
.add_plugins(DefaultPlugins)
.insert_resource(WinitSettings::desktop_app())
.insert_resource(WindowDescriptor {
present_mode: PresentMode::Mailbox,
Copy link
Owner

@mvlabat mvlabat Apr 16, 2022

Choose a reason for hiding this comment

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

Is PresentMode::Mailbox needed in this example?

examples/ui.rs Outdated
Comment on lines 27 to 30
.insert_resource(WinitSettings::desktop_app())
.init_resource::<UiState>()
.add_plugins(DefaultPlugins)
.insert_resource(WinitSettings::desktop_app())
Copy link
Owner

Choose a reason for hiding this comment

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

I guess one of these is redundant

@mvlabat
Copy link
Owner

mvlabat commented Apr 16, 2022

Thanks a lot for the PR! I'll make a new release soon.

@mvlabat mvlabat mentioned this pull request Apr 16, 2022
@mvlabat mvlabat merged commit 011a4c2 into mvlabat:main Apr 16, 2022
@aevyrie
Copy link
Contributor Author

aevyrie commented Apr 16, 2022

@mvlabat something I added that could use more discussion was the present_mode and the WinitSettings for low power. Maybe these should be removed from the examples, and instead added to a dektop_app example or something. It would be good to discuss how you can use these settings to improve input latency and power use. People using this library for games probably won't want to use those settings.

HackerFoo pushed a commit to HackerFoo/bevy_egui that referenced this pull request Jul 16, 2022
* Upgrade to bevy main

* Add mailbox vsync

* Use Bevy 0.7

* Cleanup

* Add missing desktop app settings

* Fix cargo toml errors

* Clean up the examples

Co-authored-by: Forb.Jok <forbjok@gmail.com>
Co-authored-by: mvlabat <mvlabat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants