I started learning Rust, and I'm using OpenGL with it for now. I'm able to create and render my VBO just fine, but I can't seem to be able to update my VBO. Here's the function that I use to do that:
#[derive(Debug, Copy, Clone)]
pub enum BufferMode {
StaticDraw,
StaticRead,
StaticCopy,
DynamicDraw,
DynamicRead,
DynamicCopy,
StreamDraw,
StreamRead,
StreamCopy,
}
impl BufferMode {
pub fn to_raw_enum(&self) -> GLenum {
match self {
BufferMode::StaticDraw => gl::STATIC_DRAW,
BufferMode::StaticRead => gl::STATIC_READ,
BufferMode::StaticCopy => gl::STATIC_COPY,
BufferMode::DynamicDraw => gl::DYNAMIC_DRAW,
BufferMode::DynamicRead => gl::DYNAMIC_READ,
BufferMode::DynamicCopy => …