diff options
author | Sven Gothel <[email protected]> | 2012-12-30 10:53:50 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-12-30 10:53:50 +0100 |
commit | b6ae4e4dcbd740dd57de9dc3280d943e98cdaa76 (patch) | |
tree | 0a8192410a0dfdd3803825af7f5e4d999f3e525f /src/jogl/native | |
parent | 3ce0aa6e36d9474ac3105cab491a60327860757d (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.c | 22 |
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); + } +} + |