Struct glin::simple_vao::SimpleVao [−][src]
pub struct SimpleVao<T> { /* fields omitted */ }
Is a simplified version of VAO
It only allows relations of the type buffer <- attributes
It also holds a draw mode so it can be directly used as a VaoDraw
Implementations
impl<T: 'static> SimpleVao<T>
[src]
impl<T: 'static> SimpleVao<T>
[src]pub fn id(&self) -> u32
[src]
GL id
pub fn range<R: InputRange>(&self, range: R, mode: GLenum) -> Range<'_>
[src]
Returns a Range
which specifies a range of vertices and a drawing mode
Used to draw a portion of a Vao
through a Context
pub fn range_base_vertex<R: InputRange>(
&self,
range: R,
base_vertex: i32,
mode: GLenum
) -> Range<'_>
[src]
&self,
range: R,
base_vertex: i32,
mode: GLenum
) -> Range<'_>
Returns a Range
which specifies a range of vertices and a drawing mode
Used to draw a portion of a VAO
through a Context
base_vertex adds an offset to the indices See glDrawElementsBaseVertex
pub fn range_base_instance<R: InputRange>(
&self,
range: R,
base_instance: u32,
mode: GLenum
) -> Range<'_>
[src]
&self,
range: R,
base_instance: u32,
mode: GLenum
) -> Range<'_>
Returns a Range
which specifies a range of vertices and a drawing mode
Used to draw a portion of a VAO
through a Context
base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance
pub fn range_base_vertex_base_instance<R: InputRange>(
&self,
range: R,
base_vertex: i32,
base_instance: u32,
mode: GLenum
) -> Range<'_>
[src]
&self,
range: R,
base_vertex: i32,
base_instance: u32,
mode: GLenum
) -> Range<'_>
Returns a Range
which specifies a range of vertices and a drawing mode
Used to draw a portion of a VAO
through a Context
- base_vertex adds an offset to the indices
- base_instance adds an offset to the instanced attributes index
See glDrawElementsBaseVertexBaseInstance
pub fn full_range(&self) -> Range<'_>
[src]
Returns the full range of the SimpleVao
vertices
Used to draw the full SimpleVao
through a Context
pub fn full_range_base_vertex(&self, base_vertex: i32) -> Range<'_>
[src]
Returns the full range of the SimpleVao
vertices
Used to draw the full SimpleVao
through a Context
base_vertex adds an offset to the indices
See glDrawElementsBaseVertex
pub fn full_range_base_instance(&self, base_instance: u32) -> Range<'_>
[src]
Returns the full range of the SimpleVao
vertices
Used to draw the full SimpleVao
through a Context
base_vertex adds an offset to the indices
See glDrawArraysInstancedBaseInstance
pub fn full_range_base_vertex_base_instance(
&self,
base_vertex: i32,
base_instance: u32
) -> Range<'_>
[src]
&self,
base_vertex: i32,
base_instance: u32
) -> Range<'_>
Returns the full range of the SimpleVao
vertices
Used to draw the full SimpleVao
through a Context
- base_vertex adds an offset to the indices
- base_instance adds an offset to the instanced attributes index
See glDrawElementsBaseVertexBaseInstance
pub fn into_range<R: InputRange>(self, range: R) -> IntoRange
[src]
Consumes the SimpleVao
into a range
pub fn into_range_base_vertex<R: InputRange>(
self,
range: R,
base_vertex: i32
) -> IntoRange
[src]
self,
range: R,
base_vertex: i32
) -> IntoRange
Consumes the SimpleVao
into a range
base_vertex adds an offset to the indices See glDrawElementsBaseVertex
pub fn into_range_base_instance<R: InputRange>(
self,
range: R,
base_instance: u32
) -> IntoRange
[src]
self,
range: R,
base_instance: u32
) -> IntoRange
Consumes the SimpleVao
into a range
base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance
pub fn into_range_base_vertex_base_instance<R: InputRange>(
self,
range: R,
base_vertex: i32,
base_instance: u32
) -> IntoRange
[src]
self,
range: R,
base_vertex: i32,
base_instance: u32
) -> IntoRange
Consumes the SimpleVao
into a range
- base_vertex adds an offset to the indices
- base_instance adds an offset to the instanced attributes index
See glDrawElementsBaseVertexBaseInstance
pub fn into_full_range(self) -> IntoRange
[src]
Consumes the SimpleVao
into it’s full range
pub fn into_full_range_base_vertex(self, base_vertex: i32) -> IntoRange
[src]
Consumes the SimpleVao
into it’s full range
base_vertex adds an offset to the indices See glDrawElementsBaseVertex
pub fn into_full_range_base_instance(self, base_instance: u32) -> IntoRange
[src]
Consumes the SimpleVao
into it’s full range
base_instance adds an offset to the instanced attributes index See glDrawArraysBaseInstance
pub fn into_full_range_base_vertex_base_instance(
self,
base_vertex: i32,
base_instance: u32
) -> IntoRange
[src]
self,
base_vertex: i32,
base_instance: u32
) -> IntoRange
Consumes the SimpleVao
into it’s full range
- base_vertex adds an offset to the indices
- base_instance adds an offset to the instanced attributes index
See glDrawElementsBaseVertexBaseInstance
pub fn buffer(&self) -> &Buffer<T>
[src]
Reference to the internal buffer
pub fn buffer_mut(&mut self) -> &mut Buffer<T>
[src]
Mutable reference to the internal buffer
pub fn load<'a, D: Into<Data<'a, T>>>(&mut self, data: D, usage: GLenum)
[src]
Load data into the internal buffer and indices (re)allocating them
pub fn load_vertices<V: AsRef<[T]>>(&mut self, data: V, usage: GLenum)
[src]
Load vertices into the internal buffer (re)allocating it
pub fn load_indices(&mut self, indices: &[IndexT], usage: GLenum) -> Result<()>
[src]
Load indices into the internal buffer (re)allocating it
pub fn update_vertices<V: AsRef<[T]>>(&mut self, data: V)
[src]
Update the vertices in the internal buffer
Will panic if the capacity of the buffer is not enough to hold the passed data
pub fn update_indices(&mut self, indices: &[IndexT])
[src]
Update the indices in the internal buffer
Will panic if the capacity of the buffer is not enough to hold the passed data
pub fn enable(&mut self, attr_name: &str) -> Result<()>
[src]
Enable an attribute by name
pub fn disable(&mut self, attr_name: &str) -> Result<()>
[src]
Disable an attribute by name
pub fn enable_indices(&mut self)
[src]
Enable the indices in the VAO
pub fn disable_indices(&mut self)
[src]
Disable the indices in the VAO
pub fn len(&self) -> usize
[src]
Returns the len of the internal vertex buffer
pub fn len_indices(&self) -> usize
[src]
Returns the len of the internal index buffer
pub fn is_empty(&self) -> bool
[src]
pub fn mode(&self) -> GLenum
[src]
Returns the draw mode
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the internal vertex buffer
pub fn capacity_indices(&self) -> usize
[src]
Returns the capacity of the internal index buffer
pub fn set_mode(&mut self, mode: GLenum)
[src]
Change the draw mode
pub fn into_vao(self) -> Vao
[src]
Trait Implementations
impl<'a, T> VaoRange for &'a SimpleVao<T>
[src]
impl<'a, T> VaoRange for &'a SimpleVao<T>
[src]fn id(&self) -> GLuint
[src]
fn start(&self) -> usize
[src]
fn end(&self) -> usize
[src]
fn count(&self) -> usize
[src]
fn num_indices(&self) -> usize
[src]
fn num_vertices(&self) -> usize
[src]
fn has_indices(&self) -> bool
[src]
fn base_vertex(&self) -> Option<i32>
[src]
fn base_instance(&self) -> Option<u32>
[src]
impl<'a, T> VaoRange for &'a mut SimpleVao<T>
[src]
impl<'a, T> VaoRange for &'a mut SimpleVao<T>
[src]fn id(&self) -> GLuint
[src]
fn start(&self) -> usize
[src]
fn end(&self) -> usize
[src]
fn count(&self) -> usize
[src]
fn num_indices(&self) -> usize
[src]
fn num_vertices(&self) -> usize
[src]
fn has_indices(&self) -> bool
[src]
fn base_vertex(&self) -> Option<i32>
[src]
fn base_instance(&self) -> Option<u32>
[src]
impl<T> Eq for SimpleVao<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for SimpleVao<T>
impl<T> !Send for SimpleVao<T>
impl<T> !Sync for SimpleVao<T>
impl<T> Unpin for SimpleVao<T> where
T: Unpin,
T: Unpin,