I’m using picking & the selection buffer with JOGL.
Here is the native code for glSelectBuffer
JNIEXPORT void JNICALL
Java_net_java_games_jogl_impl_windows_WindowsGLImpl_glSelectBuffer(JNIEnv *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);
}
}
I’m concerned that I fill the buffer and query it after this call. However, there seems to be no guarantee that the JVM hasn’t moved the array somewhere or even that it passed a copy over in the first place.
Am I missing something or is it just unsafe?
Tim