Foo

Struct Foo 

Source
pub struct Foo { /* private fields */ }
Expand description

This type wraps the program with the foo.vert and foo.frag shaders.

Implementations§

Source§

impl Foo

Source

pub fn with_uniforms<'program>(&'program self) -> FooDraw<'program, (), ()>

Creates a builder type to assign uniforms one by one.

Source

pub fn with_default_uniforms<'program>( &'program self, ) -> FooDraw<'program, f32, Matrix4<f32>>

Creates a builder type with all uniforms assigned to the Default value.

Trait Implementations§

Source§

impl Program for Foo

Source§

type AttrStruct = FooAttr

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

fn create_internally(context: &Context) -> Self

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

fn compile_shaders(&self, context: &Context)

Compiles the vertex and fragment shaders.
Attaches and links the vertex and fragment shaders.
Source§

fn apply_attrs(&self, context: &Context, buffer: &Buffer<Self::AttrStruct>)

Applies the buffer ot the attributes in this program.
Source§

fn create(context: &Context) -> Self

Compiles and links the program in the given Context.
Source§

fn prepare_buffer( context: &Context, attrs: &[Self::AttrStruct], usage: BufferDataUsage, ) -> Buffer<Self::AttrStruct>

Prepares a buffer with the attributes in the vec.
Source§

fn draw_fully( &self, context: &Context, mode: RenderPrimitiveType, buffer: &Buffer<Self::AttrStruct>, items: impl RangeBounds<usize>, )

Runs the program with the given attributes.
Source§

fn draw_indexed( &self, context: &Context, mode: RenderPrimitiveType, buffer: &Buffer<Self::AttrStruct>, indices: &Indices, items: impl RangeBounds<usize>, )

Runs the program with the given attributes indexed by indices.

Auto Trait Implementations§

§

impl !Freeze for Foo

§

impl RefUnwindSafe for Foo

§

impl !Send for Foo

§

impl !Sync for Foo

§

impl Unpin for Foo

§

impl UnwindSafe for Foo

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.