summaryrefslogtreecommitdiffstats
path: root/src/jogl/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-11-22 17:10:58 +0100
committerSven Gothel <[email protected]>2019-11-22 17:10:58 +0100
commite674f4fa0e795bd67335025123f9af727d856f7d (patch)
tree7138ad7c1216e552f8fed52bc91d14e627716bde /src/jogl/native
parent39169a80b7b1f604c4da2456c9f4852d2c8c0600 (diff)
Bug 1156: Utilize internal glGetStringi (same as glGetString) - Robostness
Using EGL-GBM, using desktop GL we end up with an unsatisfied linkage error after the ProcAddressTable has been reset using the 'hasMajor' and 'hasCtxOptions'. However looking up using 'reqMajor' and 'reqCtxOptions' seems to work. Needs more analysis. This change also increases robustness for scanning through GL profiles at initialization.
Diffstat (limited to 'src/jogl/native')
-rw-r--r--src/jogl/native/GLContext.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jogl/native/GLContext.c b/src/jogl/native/GLContext.c
index 9be9f82af..e1fbb796f 100644
--- a/src/jogl/native/GLContext.c
+++ b/src/jogl/native/GLContext.c
@@ -7,6 +7,23 @@
/*
* Class: jogamp_opengl_GLContextImpl
+ * Method: glGetStringiInt
+ * Signature: (IIJ)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_jogamp_opengl_GLContextImpl_glGetStringiInt(JNIEnv *env, jclass _unused, jint name, jint index, jlong procAddress) {
+ typedef const khronos_uint8_t * (KHRONOS_APIENTRY*_local_PFNGLGETSTRINGIPROC)(unsigned int name, unsigned int index);
+ _local_PFNGLGETSTRINGIPROC ptr_glGetStringi;
+ const khronos_uint8_t * _res;
+ ptr_glGetStringi = (_local_PFNGLGETSTRINGIPROC) (intptr_t) procAddress;
+ assert(ptr_glGetStringi != NULL);
+ _res = (* ptr_glGetStringi) ((unsigned int) name, (unsigned int)index);
+ if (NULL == _res) return NULL;
+ return (*env)->NewStringUTF(env, (const char *)_res);
+}
+
+/*
+ * Class: jogamp_opengl_GLContextImpl
* Method: glGetStringInt
* Signature: (IJ)Ljava/lang/String;
*/