I tried to use this tutorial with Golang: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-2-the-first-triangle/ The go-version opens the window and makes the bac
I don't know how the OpenGL bindings to Go look exactly, but I can tell you at least this much:
The last parameter to glVertexAttribPointer
should be the byte offset from the start of the buffer object, so (in your case) 0.
Note: The C type of that parameter generally should be
int
, as it's a byte offset. Instead, it'svoid*
for legacy reasons - it used to have a different meaning before VBOs.
Instead of &f
try passing either a literal 0 or, if this doesn't work, a pointer with value equal to 0. How to do that in Go? This is for you to figure out, since I don't grok Go. I told you what OpenGL expects and I hope this much helps.
Also: For debugging, please check glGetError()
often.