Skip to main content

WgpuCustomRender

Trait WgpuCustomRender 

Source
pub trait WgpuCustomRender {
    // Required method
    fn render(&mut self, ctx: WgpuCustomRenderCtx<'_>);
}
Expand description

Trait implemented by widgets that want to inject custom wgpu render commands into the frame.

render is called from end_frame() once per matching DrawCommand::Custom queued during paint(). Implementations are typically held in Rc<RefCell<dyn WgpuCustomRender>> so the widget can lazy-init GPU state on first use and persist it across frames.

Required Methods§

Source

fn render(&mut self, ctx: WgpuCustomRenderCtx<'_>)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§