pub struct Foo { /* private fields */ }Expand description
This type wraps the program with the foo.vert and foo.frag shaders.
Implementations§
Trait Implementations§
Source§impl Program for Foo
impl Program for Foo
Source§type AttrStruct = FooAttr
type AttrStruct = FooAttr
The struct generated for storing attributes.
Always
#[repr(C)].Source§fn create_internally(context: &Context) -> Self
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)
fn compile_shaders(&self, context: &Context)
Compiles the vertex and fragment shaders.
Source§fn link_shaders(&self, context: &Context)
fn link_shaders(&self, context: &Context)
Attaches and links the vertex and fragment shaders.
Source§fn apply_attrs(&self, context: &Context, buffer: &Buffer<Self::AttrStruct>)
fn apply_attrs(&self, context: &Context, buffer: &Buffer<Self::AttrStruct>)
Applies the buffer ot the attributes in this program.
Source§fn prepare_buffer(
context: &Context,
attrs: &[Self::AttrStruct],
usage: BufferDataUsage,
) -> Buffer<Self::AttrStruct>
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>,
)
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>,
)
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.