Bug 466

Summary: glBufferData does not copy the buffer
Product: [JogAmp] Jogl Reporter: devluz
Component: openglAssignee: Sven Gothel <sgothel>
Status: VERIFIED INVALID    
Severity: major    
Priority: ---    
Version: 2   
Hardware: pc_all   
OS: windows   
Type: --- SCM Refs:
Workaround: ---
Attachments: a startable java program. the two buffers should contain the same values. but they does not

Description devluz 2011-01-30 23:32:11 CET
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.
Comment 1 Sven Gothel 2011-02-26 01:57:03 CET
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:
  verticiesBB.order(ByteOrder.nativeOrder());
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 ?