Struct egui::PaintCallback
source · [−]pub struct PaintCallback {
pub rect: Rect,
pub callback: Arc<dyn Fn(&PaintCallbackInfo, &(dyn Any + 'static)) + Sync + Send + 'static>,
}
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 + 'static)) + Sync + Send + 'static>
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 + 'static))
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) -> Shape
fn from(shape: PaintCallback) -> Shape
Converts to this type from the input type.
sourceimpl PartialEq<PaintCallback> for PaintCallback
impl PartialEq<PaintCallback> for PaintCallback
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more