Relative Content

Tag Archive for rustopengl3dgame-developmentglfw

Rust buffers not being sent to OpenGL correctly?

I’m trying to use OpenGL in rust using the gl crate and rust bindings to glfw. I’ve had some success with OpenGL in C, but for this project, I am just trying to port the “hello triangle” code from LearnOpenGL.com. Link To Source . Using the original vertices provided I noticed the triangle was not where it was supposed to be. At first I thought it was the viewport, but eventually I messed with the vertices themselves and the results are not what I would have expected. So I inserted calls to gl::GetBufferSubData to see if I would get back what I expect, and I don’t at all. I think there must be a basic memory/pointer error going on, or a bad typecast or something like that, but I really can’t figure it out. It’s also possible that my calls to gl::GetSubBufferData are wrong somehow too, but I would think they would be wrong in a similar way.