Bug 36

Summary: glSelectBuffer/glFeedbackBuffer need direct buffers
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 1   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
Workaround: ---

Description Sven Gothel 2010-03-24 07:45:49 CET


---- Reported by timniblett 2003-09-07 15:34:12 ----

Here is the native code for glSelectBuffer 
 
JNIEXPORT void JNICALL  
Java_net_java_games_jogl_impl_windows_WindowsGLImpl_glSelectBuffer(JNIEn 
v *env, jobject _unused, jint size, jintArray buffer) { 
  GLuint * _ptr1 = NULL; 
  if (buffer != NULL) { 
    _ptr1 = (GLuint *) (*env)->GetPrimitiveArrayCritical(env, buffer, NULL); 
  } 
  glSelectBuffer((GLsizei) size, (GLuint *) _ptr1); 
  if (buffer != NULL) { 
    (*env)->ReleasePrimitiveArrayCritical(env, buffer, _ptr1, JNI_ABORT); 
  } 
} 
 
The "natural" way to use this is to fill the buffer and query it _after_ this call.  
However, there is no guarantee that the JVM hasn't moved the array somewhere 
or even that it passed a copy over in the first place. Using direct buffers would 
clear this up.



---- Additional Comments From kbr 2004-04-08 12:13:20 ----

This needs to be fixed by changing these routines to be NIO-only in the GlueGen
configuration file. Unfortunately this is an incompatible API change. We'll do
one more release under the current version number, bump the version number and
make the change.




---- Additional Comments From kbr 2004-04-20 18:42:27 ----

GlueGen has been updated to understand conversions from non-void* C
primitive pointer types to java.nio.Buffer subclasses. Some new
directives have been added to the JavaConfiguration class to control
emission of java.nio variants on a slightly finer grain, while also
allowing the default behavior to be changed to emit many more
combinations of java.nio and Java primitive array overloadings for
these functions. glSelectBuffer and glFeedbackBuffer have been made
NIO-only. The glue code for glEdgeFlagPointerEXT was also incorrect
and has been fixed by this change.




--- Bug imported by sgothel@jausoft.com 2010-03-24 07:45 EDT  ---

This bug was previously known as _bug_ 36 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=36