1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Add Shape::Callback to do custom rendering inside of an egui UI (#1351)

* Add Shape::Callback to do custom rendering inside of an egui UI
* Use Rc<glow::Context> everywhere
* Remove trait WebPainter
* Add glow::Context to epi::App::setup
This commit is contained in:
Emil Ernerfeldt
2022-03-14 13:25:11 +01:00
committed by GitHub
parent 002158050b
commit 6aee4997d4
34 changed files with 777 additions and 385 deletions

View File

@@ -19,6 +19,7 @@ impl epi::App for DemoApp {
_ctx: &egui::Context,
_frame: &epi::Frame,
_storage: Option<&dyn epi::Storage>,
_gl: &std::rc::Rc<epi::glow::Context>,
) {
#[cfg(feature = "persistence")]
if let Some(storage) = _storage {

View File

@@ -148,8 +148,8 @@ fn test_egui_e2e() {
let full_output = ctx.run(raw_input.clone(), |ctx| {
demo_windows.ui(ctx);
});
let clipped_meshes = ctx.tessellate(full_output.shapes);
assert!(!clipped_meshes.is_empty());
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(!clipped_primitives.is_empty());
}
}
@@ -167,8 +167,11 @@ fn test_egui_zero_window_size() {
let full_output = ctx.run(raw_input.clone(), |ctx| {
demo_windows.ui(ctx);
});
let clipped_meshes = ctx.tessellate(full_output.shapes);
assert!(clipped_meshes.is_empty(), "There should be nothing to show");
let clipped_primitives = ctx.tessellate(full_output.shapes);
assert!(
clipped_primitives.is_empty(),
"There should be nothing to show"
);
}
}

View File

@@ -47,6 +47,7 @@ impl epi::App for WrapApp {
_ctx: &egui::Context,
_frame: &epi::Frame,
_storage: Option<&dyn epi::Storage>,
_gl: &std::rc::Rc<epi::glow::Context>,
) {
#[cfg(feature = "persistence")]
if let Some(storage) = _storage {