|
From: Elias N. <eli...@us...> - 2005-11-21 13:32:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543/src/native/linux Modified Files: display.c Log Message: Linux: Moved a display connection creation to java Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- display.c 21 Nov 2005 13:22:52 -0000 1.13 +++ display.c 21 Nov 2005 13:32:52 -0000 1.14 @@ -130,26 +130,12 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXrandrSupported(JNIEnv *env, jclass unused) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return JNI_FALSE; - } - - jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE; - XCloseDisplay(disp); + jboolean result = isXrandrSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXF86VidModeSupported(JNIEnv *env, jclass unused) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return JNI_FALSE; - } - - jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE; - XCloseDisplay(disp); + jboolean result = isXF86VidModeSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } |