glBufferData and glBufferSubData seems not to work
Posted by
Henry Rust on
Aug 19, 2011; 6:51am
URL: https://forum.jogamp.org/glBufferData-and-glBufferSubData-seems-not-to-work-tp3267295.html
Hello everyone,
using the latest autobuild, I guess I have found a bug in jogl. Everytime I use glBufferData or glBufferSubData the transmitted data seems to be completly empty. I discoevered this bug after coding a little test application, because I wanted to check how things in OpenGL work. The test application didn't displan anything, but after some googling I still couldn't figure out what I was doing wrong. So I coded the same application in C++ using freeglut and there it worked. So I compared the code, but they both were equivlant, except for the different language classes (e.g Buffers in Java, vector in C++ for storing to be transmitted data). Finally I checked with apitrace, a very useful tool, that displays all OpenGL functions calls an application makes, and even there the calls there the same. But I noticed that in the java the data actually transmitted to the GPU via glBufferData or glBufferSubData is always empty (means containing only 0.0f). The buffer's contents are allright, I dump them before making the call. Here's a screenshot:
http://img64.imageshack.us/img64/5113/joglbug.pngused jogl autobuild b426 and gluegen autobuild b386
source code of the application (relevant parts):
http://pastebin.com/yteMn9ZSsource code of c++ application (ignore the comments):
http://pastebin.com/ndn7BVrQedit: executeable jar, if anyone cares:
http://www.file-upload.net/download-3673777/glPointerTestRunable.jar.html