Bug 466 - glBufferData does not copy the buffer
Summary: glBufferData does not copy the buffer
Status: VERIFIED INVALID
Alias: None
Product: Jogl
Classification: JogAmp
Component: opengl (show other bugs)
Version: 2
Hardware: pc_all windows
: --- major
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2011-01-30 23:32 CET by devluz
Modified: 2011-02-26 01:57 CET (History)
0 users

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments
a startable java program. the two buffers should contain the same values. but they does not (2.59 KB, text/x-java)
2011-01-30 23:32 CET, devluz
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ?