Return empty string if wglGetExtensionsStringEXT is not supported

master
Graham 5 years ago
parent 3e7c27010c
commit c17f4922c6
  1. 14
      gl-natives/src/main/c/jaggl.c

@ -748,26 +748,24 @@ JNIEXPORT void JNICALL Java_jaggl_context_setSwapInterval(JNIEnv *env, jclass cl
JNIEXPORT jstring JNICALL Java_jaggl_context_getExtensionsString(JNIEnv *env, jclass cls) { JNIEXPORT jstring JNICALL Java_jaggl_context_getExtensionsString(JNIEnv *env, jclass cls) {
JAGGL_LOCK(env); JAGGL_LOCK(env);
jstring extensions; const char *extensions_str;
#if defined(__unix__) #if defined(__unix__)
const char *extensions_str = glXQueryExtensionsString(jaggl_display, jaggl_visual_info->screen); extensions_str = glXQueryExtensionsString(jaggl_display, jaggl_visual_info->screen);
extensions = (*env)->NewStringUTF(env, extensions_str);
#elif defined(_WIN32) #elif defined(_WIN32)
if (jaggl_wglGetExtensionsStringEXT) { if (jaggl_wglGetExtensionsStringEXT) {
const char *extensions_str = jaggl_wglGetExtensionsStringEXT(); extensions_str = jaggl_wglGetExtensionsStringEXT();
extensions = (*env)->NewStringUTF(env, extensions_str);
} else { } else {
extensions = NULL; extensions_str = "";
} }
#elif defined(__APPLE__) && defined(__MACH__) #elif defined(__APPLE__) && defined(__MACH__)
extensions = (*env)->NewStringUTF(env, ""); extensions_str = "";
#else #else
#error Unsupported platform #error Unsupported platform
#endif #endif
JAGGL_UNLOCK(env); JAGGL_UNLOCK(env);
return extensions; return (*env)->NewStringUTF(env, extensions_str);
} }
JNIEXPORT jint JNICALL Java_jaggl_context_getAlphaBits(JNIEnv *env, jclass cls) { JNIEXPORT jint JNICALL Java_jaggl_context_getAlphaBits(JNIEnv *env, jclass cls) {

Loading…
Cancel
Save