---- Reported by petermantell 2004-05-07 05:44:57 ----
The native code for glReadPixels contains the following lines at the end of the
if (pixels != NULL)
(*env)->ReleasePrimitiveArrayCritical(env, pixels, _ptr6, JNI_ABORT);
The use of JNI_ABORT signifies that the buffer will be freed but changes are
not written back into the Java array. So the data that glReadPixels returns
never ends up back in the Java array.
0 should be used instead of JNI_ABORT. See
---- Additional Comments From kbr 2005-02-03 15:21:05 ----
While the submitter is correct, this is not a problem on Sun's JDK
implementation or any other JDK that I am aware of. GetPrimitiveArrayCritical
tends to return a pointer to the actual storage of the array rather than a copy.
I'm lowering the priority of this bug. For complete correctness, GlueGen would
probably use JNI_ABORT for outgoing const pointers and 0 for outgoing non-const
---- Additional Comments From petermantell 2005-02-04 01:10:35 ----
With respect, it was a Sun JDK implementation that I was using at the time.
This bug caused us lots of problems because it makes it almost impossible to
get any data back from the buffer.
---- Additional Comments From kbr 2005-02-04 08:27:04 ----
What operating system, JDK version, and graphics card? Did you change the native
code, recompile, and see the problem disappear? Do you have a test case?
We are using glReadPixels in the core JOGL implementation with no problems. Is
it possible you were making the glReadPixels call while your GLEventListener was
---- Additional Comments From petermantell 2005-02-07 00:53:13 ----
Not sure of the answers to your questions - it was almost a year ago. I do
remember trying it on different machines though, so can't have been a card
---- Additional Comments From kbr 2006-01-11 00:05:08 ----
Changed use of JNI_ABORT to 0 in ReleasePrimitiveArrayCritical calls. This
should not change the behavior of the generated glue code in any way, at least
on the HotSpot JVM, but is being done for completeness of the GlueGen tool.
--- Bug imported by email@example.com 2010-03-24 07:46 EDT ---
This bug was previously known as _bug_ 84 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=84