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

Improved wgpu callbacks (#3253)

* Improved wgpu callbacks

* update documentation on egui_wgpu callbacks

* make shared callback resource map pub

* make it nicer to create epaint::PaintCallback from egui_wgpu callback

* constrain ClippedPrimitive lifetime to outlive wgpu::RenderPass

* Revert callback resources to TypeMap, put finish_prepare on callback trait

* doc string fixes
This commit is contained in:
Andreas Reich
2023-08-15 17:17:39 +02:00
committed by GitHub
parent 3c4223c6b1
commit b896d641c5
5 changed files with 196 additions and 163 deletions

View File

@@ -852,7 +852,7 @@ pub struct PaintCallback {
///
/// The concrete value of `callback` depends on the rendering backend used. For instance, the
/// `glow` backend requires that callback be an `egui_glow::CallbackFn` while the `wgpu`
/// backend requires a `egui_wgpu::CallbackFn`.
/// backend requires a `egui_wgpu::Callback`.
///
/// If the type cannot be downcast to the type expected by the current backend the callback
/// will not be drawn.
@@ -862,7 +862,9 @@ pub struct PaintCallback {
///
/// The rendering backend is also responsible for restoring any state, such as the bound shader
/// program, vertex array, etc.
pub callback: Arc<dyn Any + Sync + Send>,
///
/// Shape has to be clone, therefore this has to be an `Arc` instead of a `Box`.
pub callback: Arc<dyn Any + Send + Sync>,
}
impl std::fmt::Debug for PaintCallback {