Trait willow::Program[][src]

pub trait Program: Sized {
    type AttrStruct: AttrStruct;
    fn create_internally(gl: &Context) -> Self;
fn compile_shaders(&self, gl: &Context);
fn link_shaders(&self, gl: &Context);
fn apply_attrs(&self, context: &Context, buffer: &Buffer<Self::AttrStruct>); fn create(context: &Context) -> Self { ... }
fn prepare_buffer(
        context: &Context,
        attrs: &[Self::AttrStruct],
        usage: BufferDataUsage
    ) -> Buffer<Self::AttrStruct> { ... }
fn draw_fully(
        &self,
        context: &Context,
        mode: RenderPrimitiveType,
        buffer: &Buffer<Self::AttrStruct>,
        items: impl RangeBounds<usize>
    ) { ... } }
Expand description

Represents WebGL programs.

This type should only be implemented by the Program macro.

Associated Types

The struct generated for storing attributes. Always #[repr(C)].

Required methods

Creates an instance of the type. Allocate necessary resources like gl.createShader().

Compiles the vertex and fragment shaders.

Attaches and links the vertex and fragment shaders.

Applies the buffer ot the attributes in this program.

Provided methods

Compiles and links the program in the given Context.

Prepares a buffer with the attributes in the vec.

Runs the program with the given attributes.

Implementors