mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Replace Context::begin_frame/end_frame with fn run taking a closure (#872)
* Replace Context begin_frame/end_frame with `fn run` taking a closure * Create `egui::__run_test_ui` to replace `Ui::__test` * Add helper `egui::__run_test_ctx` for doctests
This commit is contained in:
@@ -150,14 +150,10 @@ impl EguiGlow {
|
||||
pub fn run(
|
||||
&mut self,
|
||||
window: &glutin::window::Window,
|
||||
mut run_ui: impl FnMut(&egui::CtxRef),
|
||||
run_ui: impl FnMut(&egui::CtxRef),
|
||||
) -> (bool, Vec<egui::epaint::ClippedShape>) {
|
||||
let raw_input = self.egui_winit.take_egui_input(window);
|
||||
self.egui_ctx.begin_frame(raw_input);
|
||||
|
||||
run_ui(&self.egui_ctx);
|
||||
|
||||
let (egui_output, shapes) = self.egui_ctx.end_frame();
|
||||
let (egui_output, shapes) = self.egui_ctx.run(raw_input, run_ui);
|
||||
let needs_repaint = egui_output.needs_repaint;
|
||||
self.egui_winit
|
||||
.handle_output(window, &self.egui_ctx, egui_output);
|
||||
|
||||
Reference in New Issue
Block a user