From: Luke H. <lh...@us...> - 2002-11-26 03:30:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv20942 Modified Files: org_lwjgl_Display.cpp Log Message: Added a fix for when GLX_ALPHA_SIZE cant be set (I think this happens when display depth is below 24.) There might be a better way to handle this... but this lets lwjgl work for me. =) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_Display.cpp 20 Nov 2002 13:54:58 -0000 1.3 +++ org_lwjgl_Display.cpp 26 Nov 2002 03:30:41 -0000 1.4 @@ -102,8 +102,26 @@ Colormap cmap; int attribmask; int bpe = bpp/4; - int attriblist[] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_RED_SIZE, bpe, GLX_GREEN_SIZE, bpe, GLX_BLUE_SIZE, bpe, GLX_ALPHA_SIZE, bpe, None}; - int num_modes, i; + int attriblist[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 24, + GLX_RED_SIZE, bpe, + GLX_GREEN_SIZE, bpe, + GLX_BLUE_SIZE, bpe, + GLX_ALPHA_SIZE, bpe, + None }; + int attriblistna[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 24, + GLX_RED_SIZE, bpe, + GLX_GREEN_SIZE, bpe, + GLX_BLUE_SIZE, bpe, + None }; + + int num_modes, i; + + + current_fullscreen = fullscreen; current_focused = 0; @@ -125,7 +143,13 @@ root_win = RootWindow(disp, screen); vis_info = glXChooseVisual(disp, screen, attriblist); - if (vis_info == NULL) { + + /* might be a better way to handle not being able to set GLX_ALPHA_SIZE... */ + if (vis_info == NULL) { + vis_info = glXChooseVisual(disp, screen, attriblistna); + } + + if (vis_info == NULL) { XCloseDisplay(disp); #ifdef _DEBUG printf("Could not choose glx visual\n"); |