-
Notifications
You must be signed in to change notification settings - Fork 262
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.10 #159
Conversation
Fix build error from missing add_systems_to_schedule
Bevy 0.10
Ci seems to complain about a mutable reference in |
I'm seeing the following warnings in the
I'd be grateful if anyone could pick up this issue. I won't have time to return to the PR until the evening. |
I've been trying to track down the In the ui example, it comes from changing the We then set We get the shapes in let full_output = ctx.end_frame();
let egui::FullOutput {
platform_output,
shapes,
textures_delta,
repaint_after,
} = full_output;
egui_render_output.shapes = shapes; I think it only shows the warning for one frame if |
examples/simple.rs
Outdated
fn ui_example_system(mut egui_ctx: Query<&mut EguiContext, With<PrimaryWindow>>) { | ||
egui::Window::new("Hello").show(egui_ctx.single_mut().get_mut(), |ui| { |
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.
can it be simplified like this?
fn ui_example_system(mut egui_ctx: Query<&mut EguiContext, With<PrimaryWindow>>) { | |
egui::Window::new("Hello").show(egui_ctx.single_mut().get_mut(), |ui| { | |
fn ui_example_system(egui_ctx: Query<&EguiContext, With<PrimaryWindow>>) { | |
egui::Window::new("Hello").show(egui_ctx.single(), |ui| { |
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.
Only if we implement Deref
and DerefMut
for EguiContext
, giving people an interface to borrow the context immutably, which I'm hesitant to do due to the following:
https://github.com/mvlabat/bevy_egui/blob/7151c40f8564650fdfad5eaa15e72d055d0a5893/src/lib.rs#L247-L256
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 ended up introducing the EguiContexts
system param, to combine the best of both worlds: low boilerplate and mutable borrowing by default.
@DGriffin91 thanks for looking into this! That definitely saved me time investigating. It seems that I was able to fix the warning here: 7151c40. |
The PR is almost finished. I'll let people review the API changes, and tomorrow morning I'll push the last bits of the documentation fixes and make a release. |
Co-authored-by: Jakob Hellermann <[email protected]>
Based on #148