I was recently watching a tutorial on writing an OpenGL game in Java with LWJGL. In it, the narrator/author first converts the float array from float[]
to a FloatBuffer
before giving it toGL15.glBufferData()
. Initially I didn't think much of this, but I accidentally gave GL15.glBufferData()
the float array directly instead of converting it to a FloatBuffer
, and the code ended up working anyway. I looked up the documentation and it only says "Array version of: BufferData" as comment, which still leaves me uncertain.
This leads me to wonder, is there any point of going through the effort to convert float[]
to a FloatBuffer
when calling GL15.glBufferData()
in LWJGL 3.0 with Java 15, assuming the FloatBuffer
was given its value by using FloatBuffer::put()
and thus contains the same data?