Struct epaint::PaintCallback
source · [−]pub struct PaintCallback {
pub rect: Rect,
pub callback: Arc<dyn Fn(&PaintCallbackInfo, &dyn Any) + Send + Sync>,
}
Expand description
If you want to paint some 3D shapes inside an egui region, you can use this.
This is advanced usage, and is backend specific.
Fields
rect: Rect
Where to paint.
callback: Arc<dyn Fn(&PaintCallbackInfo, &dyn Any) + Send + Sync>
Paint something custom (e.g. 3D stuff).
The argument is the render context, and what it contains depends on the backend.
In eframe
it will be egui_glow::Painter
.
The rendering backend is responsible for first setting the active viewport to Self::rect
.
The rendering backend is also responsible for restoring any state, such as the bound shader program and vertex array.
Implementations
sourceimpl PaintCallback
impl PaintCallback
pub fn call(&self, info: &PaintCallbackInfo, render_ctx: &dyn Any)
Trait Implementations
sourceimpl Clone for PaintCallback
impl Clone for PaintCallback
sourcefn clone(&self) -> PaintCallback
fn clone(&self) -> PaintCallback
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PaintCallback
impl Debug for PaintCallback
sourceimpl From<PaintCallback> for Shape
impl From<PaintCallback> for Shape
sourcefn from(shape: PaintCallback) -> Self
fn from(shape: PaintCallback) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for PaintCallback
impl Send for PaintCallback
impl Sync for PaintCallback
impl Unpin for PaintCallback
impl !UnwindSafe for PaintCallback
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more