|
From: Elias N. <eli...@us...> - 2005-05-27 11:50:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31116/src/native/linux Modified Files: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c Log Message: Linux AWT: in case we're not on a SUN jdk, try to determine values instead of bombing out. This should help us compile and run on gcj Index: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 20 Feb 2005 11:24:22 -0000 1.1 +++ org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 27 May 2005 11:50:13 -0000 1.2 @@ -60,6 +60,22 @@ // Get the platform-specific drawing info JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo; + // If we couldn't get a screen from java side, attempt to determine a sane screen + // from the information we do have, namely the visualid and the depth + if (screen == -1) { + XVisualInfo template; + int num_infos; + template.visualid = dsi_x11->visualID; + template.depth = dsi_x11->depth; + XVisualInfo *vis_info = XGetVisualInfo(peer_info->display, VisualIDMask | VisualDepthMask, &template, &num_infos); + if (vis_info == NULL) { + throwException(env, "Could not determine screen"); + return; + } + screen = vis_info[0].screen; + XFree(vis_info); + } + peer_info->display = dsi_x11->display; peer_info->screen = screen; peer_info->drawable = dsi_x11->drawable; |