Buffer bind clean-up
@@ -40,7 +40,6 @@ impl VertexBuffer
{
let id = gl.create_buffer().unwrap();
let buffer = VertexBuffer{gl: gl.clone(), id, stride:0, attributes_infos: Vec::new() };
- buffer.bind();
Ok(buffer)
}
@@ -115,7 +114,6 @@ impl ElementBuffer
{
let id = gl.create_buffer().unwrap();
let buffer = ElementBuffer{ gl: gl.clone(), id };
- buffer.bind();
Ok(buffer)
}
@@ -133,7 +131,7 @@ impl ElementBuffer
pub fn fill_with(&self, data: &[u32])
{
- bind(&self.gl, &self.id, gl::consts::ELEMENT_ARRAY_BUFFER);
+ self.bind();
self.gl.buffer_data_u32(gl::consts::ELEMENT_ARRAY_BUFFER, data, gl::consts::STATIC_DRAW);
}
}
