I'm playing around with OpenGL and Go. It's mostly pretty intuitive, but there is a few awkward interface problems. The second argument of glBufferData should be the size of the buffer in memory.
C.glBufferData(C.GLenum(target), C.GLsizeiptr(size), ptr(data), C.GLenum(usage))
In the case that the buffer contains 32 bit floats each element will take of 4 bytes, so for the second argument I can do something like:
sizeofFloat := 4
size := sizeofFloat * len(buffer)
C.glBufferData(C.GLenum(target), C.GLsizeiptr(size), ptr(data), C.GLenum(usage))
Is there a better way to get the size of a type in memory other than just hard coding it?