Struct rin::gl::vao::Vao[][src]

pub struct Vao { /* fields omitted */ }

A wrapper for an OpenGL VAO

VAO Uses the DSA model for creating vertex array objects and binding attributes to it.

Internally it uses the types in the attributes module to bind buffers to the different attributes.

VAO binds buffers to vertex buffer binding points using VertexBufferBindingT and allows to specify a divisor for each of those bindings.

Then binds attributes by their location and format to one of the previously specified binding points

This allows to specify a relation 1:N 1:N between buffers -> binding points <- attributes

Where a buffer can be bound to 1 or more binding points and one or more attributes can read from one binding point. See the attributes module for more specifics about how this is implemented

A VAO can also optionally include an indices buffer.

A VAO takes ownership of the buffers it binds to binding points. In order to bind a buffer in several VAO you can use a SharedBuffer or a reference to a Buffer.

Implementations

impl Vao[src]

pub fn id(&self) -> u32[src]

pub fn len(&self) -> usize[src]

Returns the number of vertices of the VAO

Calculated as the max len of all the underlying vertex buffers

pub fn is_empty(&self) -> bool[src]

Returns true all the internal vertex buffers are empty

pub fn range<R>(&self, range: R, mode: u32) -> Range<'_> where
    R: InputRange
[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>(
    &self,
    range: R,
    base_vertex: i32,
    mode: u32
) -> Range<'_> where
    R: InputRange
[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 base_vertex adds an offset to the indices See glDrawElementsBaseVertex

pub fn range_base_instance<R>(
    &self,
    range: R,
    base_instance: u32,
    mode: u32
) -> Range<'_> where
    R: InputRange
[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 base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance

pub fn range_base_vertex_base_instance<R>(
    &self,
    range: R,
    base_vertex: i32,
    base_instance: u32,
    mode: u32
) -> Range<'_> where
    R: InputRange
[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

  • 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, mode: u32) -> Range<'_>[src]

Returns the full range of the Vao vertices

Used to draw the full VAO through a Context

pub fn full_range_base_vertex(&self, base_vertex: i32, mode: u32) -> Range<'_>[src]

Returns the full range of the Vao vertices

Used to draw the full VAO through a Context base_vertex adds an offset to the indices See glDrawElementsBaseVertex

pub fn full_range_base_instance(
    &self,
    base_instance: u32,
    mode: u32
) -> Range<'_>
[src]

Returns the full range of the Vao vertices

Used to draw the full VAO through a Context base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance

pub fn full_range_base_vertex_base_instance(
    &self,
    base_vertex: i32,
    base_instance: u32,
    mode: u32
) -> Range<'_>
[src]

Returns the full range of the Vao vertices

Used to draw the full 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 into_range<R>(self, range: R, mode: u32) -> IntoRange where
    R: InputRange
[src]

Consumes the Vao into a range

pub fn into_range_base_vertex<R>(
    self,
    range: R,
    base_vertex: i32,
    mode: u32
) -> IntoRange where
    R: InputRange
[src]

Consumes the Vao into a range

base_vertex adds an offset to the indices See glDrawElementsBaseVertex

pub fn into_range_base_instance<R>(
    self,
    range: R,
    base_instance: u32,
    mode: u32
) -> IntoRange where
    R: InputRange
[src]

Consumes the Vao into a range

base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance

pub fn into_range_base_vertex_base_instance<R>(
    self,
    range: R,
    base_vertex: i32,
    base_instance: u32,
    mode: u32
) -> IntoRange where
    R: InputRange
[src]

Consumes the Vao 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, mode: u32) -> IntoRange[src]

Consumes the VAO into it’s full range

pub fn into_full_range_base_vertex(
    self,
    base_vertex: i32,
    mode: u32
) -> IntoRange
[src]

Consumes the VAO 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,
    mode: u32
) -> IntoRange
[src]

Consumes the VAO into it’s full range

base_instance adds an offset to the instanced attributes index See glDrawArraysInstancedBaseInstance

pub fn into_full_range_base_vertex_base_instance(
    self,
    base_vertex: i32,
    base_instance: u32,
    mode: u32
) -> IntoRange
[src]

Consumes the VAO 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 enable(&mut self, attr_name: &str) -> Result<(), Error>[src]

Enable an attribute by name

pub fn disable(&mut self, attr_name: &str) -> Result<(), Error>[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 buffer<T, B>(&self, index: usize) -> Option<&B> where
    B: 'static + BufferRange<T>,
    T: 'static, 
[src]

Reference to an internal buffer by it’s index and type

pub fn buffer_mut<T, B>(&mut self, index: usize) -> Option<&mut B> where
    B: 'static + BufferRange<T>,
    T: 'static, 
[src]

Mutable reference to an internal buffer by it’s index and type

pub fn indices_buffer<B>(&self) -> Option<&B> where
    B: 'static + BufferRangeMut<u32>, 
[src]

Reference to the indices buffer by it’s index and type

pub fn indices_buffer_mut<B>(&mut self) -> Option<&mut B> where
    B: 'static + BufferRangeMut<u32>, 
[src]

Mutable reference to the indices buffer by it’s index and type

pub fn set_indices_buffer<B>(&mut self, buffer: B) where
    B: 'static + BufferRangeMut<u32>, 
[src]

pub fn set_attributes_buffer<T, B, I>(
    &mut self,
    formats: I,
    buffer: B
) -> Result<(), Error> where
    B: BufferRange<T> + 'static,
    T: 'static,
    I: Into<Vec<Format, Global>>, 
[src]

pub fn set_instance_attributes_buffer<T, B, I>(
    &mut self,
    formats: I,
    buffer: B,
    divisor: usize
) -> Result<(), Error> where
    B: BufferRange<T> + 'static,
    T: 'static,
    I: Into<Vec<Format, Global>>, 
[src]

pub fn set_attribute_buffer_at<T, B>(
    &mut self,
    index: usize,
    buffer: B
) -> Result<(), Error> where
    B: BufferRange<T> + 'static,
    T: 'static, 
[src]

pub fn set_instance_attribute_buffer_at<T, B>(
    &mut self,
    index: usize,
    buffer: B,
    divisor: usize
) -> Result<(), Error> where
    B: BufferRange<T> + 'static,
    T: 'static, 
[src]

Trait Implementations

impl Debug for Vao[src]

impl Drop for Vao[src]

impl PartialEq<Vao> for Vao[src]

impl<'a> VaoRange for &'a Vao[src]

impl Eq for Vao[src]

Auto Trait Implementations

impl !RefUnwindSafe for Vao

impl !Send for Vao

impl !Sync for Vao

impl Unpin for Vao

impl !UnwindSafe for Vao

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]