Created attachment 224 [details]
a startable java program. the two buffers should contain the same values. but they does not
version: last from git
I uploaded a simple float buffer to opengl via glBufferData and then downloaded the buffer via glMapBuffer. The result do not contain the data of the uploaded buffer. I am new to JOGL and OpenGL3. Maybe I am wrong but it works well in a c++ exsample.
I attach an example java file to reproduce the problem.
You have chosen to not feed the data using glBufferData(..) using a non NIO buffer
and without the native order.
You have to set the ByteBuffer's order to native:
before pushing data to it and passing it to the GPU,
since the resulting NIO Buffer is of course in native order.
You could also use our NIO factory Buffers:
ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
which always uses the native order.
It works this way.
Maybe a good candidate for a glMapBuffer unit test ?