RenderResource

Trait RenderResource 

Source
pub trait RenderResource {
    type Data;

    // Required methods
    fn init(ctx: &WgpuContext, data: &Self::Data) -> Self;
    fn update(&mut self, ctx: &WgpuContext, data: &Self::Data);
}
Expand description

The RenderResource encapsules the wgpu resources.

It has a Data type that is used to initialize/update the resource.

Required Associated Types§

Required Methods§

Source

fn init(ctx: &WgpuContext, data: &Self::Data) -> Self

Initialize a RenderResource using RenderResource::Data

Source

fn update(&mut self, ctx: &WgpuContext, data: &Self::Data)

update a RenderResource using RenderResource::Data

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§