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§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VertexArray
impl RefUnwindSafe for VertexArray
impl Send for VertexArray
impl Sync for VertexArray
impl Unpin for VertexArray
impl UnwindSafe for VertexArray
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