pub struct VertexArray {
    pub id: u32,
}
Expand description

A abstract representation of a vertex array

Example

   let vertices = vec![
       0.5, 0.5, 0.0, // top right
       0.5, -0.5, 0.0, // bottom right
       -0.5, -0.5, 0.0, // bottom left
       -0.5, 0.5, 0.0, // top left
   ];
   let indices = vec![
       0, 1, 3, // first Triangle
       1, 2, 3, // second Triangle
   ];

   let vao = VertexArray::new();
   let _vbo = VertexBuffer::new(calc_bytes_size(&vertices) as isize, Some(&vertices));

   vao.bind();

   submit_vertex_attribs(&mut vec![VertexAttrib::new(
       VertexAttribType::Float3,
       false,
       "pos".to_string(),
   )]);

   let _ibo = IndexBuffer::new(calc_bytes_size(&indices) as isize, Some(&indices));

Fields

id: u32

Implementations

Return a vertext array

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.