Fixed bug when a X display connection cannot be established
This commit is contained in:
parent
24ac909558
commit
6113da5083
|
@ -443,7 +443,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_Display_getAvailableDisplayModes
|
|||
int num_modes, i;
|
||||
|
||||
Display *disp = XOpenDisplay(NULL);
|
||||
int screen = DefaultScreen(disp);
|
||||
int screen;
|
||||
XF86VidModeModeInfo **avail_modes;
|
||||
|
||||
if (disp == NULL) {
|
||||
|
@ -453,6 +453,9 @@ JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_Display_getAvailableDisplayModes
|
|||
XCloseDisplay(disp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int screen = DefaultScreen(disp);
|
||||
|
||||
if (!loadGL(disp, screen)) {
|
||||
#ifdef _DEBUG
|
||||
printf("Could not load GL\n");
|
||||
|
|
Loading…
Reference in New Issue