summaryrefslogtreecommitdiffstats
path: root/src/jogl/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-12-30 10:53:50 +0100
committerSven Gothel <[email protected]>2012-12-30 10:53:50 +0100
commitb6ae4e4dcbd740dd57de9dc3280d943e98cdaa76 (patch)
tree0a8192410a0dfdd3803825af7f5e4d999f3e525f /src/jogl/native
parent3ce0aa6e36d9474ac3105cab491a60327860757d (diff)
Cleanup / Simplify: setGLFunctionAvailability(..) / createContextARBVersions(..) GL Version Validation
String or integer based GL version validation now happens in setGLFunctionAvailability(..) depending on the requested profile. Due to the 'strictMatch' argument the method fails early when unsatisfied also allowing to simplify createContextARBVersions(..) implementation.
Diffstat (limited to 'src/jogl/native')
-rw-r--r--src/jogl/native/JoglCommon.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/jogl/native/JoglCommon.c b/src/jogl/native/JoglCommon.c
index d9f5edd49..62dd8ef21 100644
--- a/src/jogl/native/JoglCommon.c
+++ b/src/jogl/native/JoglCommon.c
@@ -149,3 +149,25 @@ Java_jogamp_opengl_GLContextImpl_glGetStringInt(JNIEnv *env, jclass _unused, jin
return (*env)->NewStringUTF(env, _res);
}
+/*
+ * Class: jogamp_opengl_GLContextImpl
+ * Method: glGetIntegervInt
+ * Signature: (ILjava/lang/Object;I)V
+ */
+JNIEXPORT void JNICALL
+Java_jogamp_opengl_GLContextImpl_glGetIntegervInt(JNIEnv *env, jclass _unused, jint pname, jobject params, jint params_byte_offset, jlong procAddress) {
+ typedef void (KHRONOS_APIENTRY*_local_PFNGLGETINTEGERVPROC)(unsigned int pname, int * params);
+
+ _local_PFNGLGETINTEGERVPROC ptr_glGetIntegerv;
+ int * _params_ptr = NULL;
+ if ( NULL != params ) {
+ _params_ptr = (int *) (((char*) (*env)->GetPrimitiveArrayCritical(env, params, NULL) ) + params_byte_offset);
+ }
+ ptr_glGetIntegerv = (_local_PFNGLGETINTEGERVPROC) (intptr_t) procAddress;
+ assert(ptr_glGetIntegerv != NULL);
+ (* ptr_glGetIntegerv) ((unsigned int) pname, (int *) _params_ptr);
+ if ( NULL != params ) {
+ (*env)->ReleasePrimitiveArrayCritical(env, params, _params_ptr, 0);
+ }
+}
+