diff options
Diffstat (limited to 'engine/src/opengl/vertex_array.rs')
-rw-r--r-- | engine/src/opengl/vertex_array.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/engine/src/opengl/vertex_array.rs b/engine/src/opengl/vertex_array.rs index e1e1a15..1f8a870 100644 --- a/engine/src/opengl/vertex_array.rs +++ b/engine/src/opengl/vertex_array.rs @@ -1,10 +1,6 @@ use std::mem::size_of; use crate::opengl::buffer::Buffer; -use crate::vertex::Vertex; - -#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)] -const VERTEX_STRIDE: i32 = size_of::<Vertex>() as i32; #[derive(Debug)] pub struct VertexArray @@ -59,10 +55,10 @@ impl VertexArray } } - pub fn bind_vertex_buffer( + pub fn bind_vertex_buffer<VertexT>( &mut self, binding_index: u32, - vertex_buffer: &Buffer<Vertex>, + vertex_buffer: &Buffer<VertexT>, offset: isize, ) { @@ -72,7 +68,7 @@ impl VertexArray binding_index, vertex_buffer.object(), offset, - VERTEX_STRIDE, + size_of::<VertexT>() as i32, ); } } @@ -127,16 +123,6 @@ impl VertexArray } } -impl Drop for VertexArray -{ - fn drop(&mut self) - { - unsafe { - gl::DeleteVertexArrays(1, &self.array); - } - } -} - #[derive(Debug)] pub enum PrimitiveKind { |