Search
lxdream.org :: lxdream :: r982:2d6b3f29f878
lxdream 0.9.1
released Jun 29
Download Now
changeset982:2d6b3f29f878
parent981:79fcace1ab43
child983:b0d0785aa194
authornkeynes
dateMon Feb 09 00:13:46 2009 +0000 (11 years ago)
Fail cleanly if the display doesn't actually support GLX, rather than crashing horribly
src/drivers/video_glx.c
1.1 --- a/src/drivers/video_glx.c Sun Feb 08 23:38:41 2009 +0000
1.2 +++ b/src/drivers/video_glx.c Mon Feb 09 00:13:46 2009 +0000
1.3 @@ -87,15 +87,21 @@
1.4 gboolean video_glx_init( Display *display, int screen )
1.5 {
1.6 int major, minor;
1.7 + int glx_major, glx_minor, glx_error;
1.8
1.9 if( glx_is_initialized ) {
1.10 return TRUE;
1.11 }
1.12
1.13 - Bool result = glXQueryVersion( display, &major, &minor );
1.14 - if( result != False ) {
1.15 - glx_version = (major*100) + minor;
1.16 + Bool result = XQueryExtension( display, "GLX", &glx_major, &glx_minor, &glx_error ) &&
1.17 + glXQueryVersion( display, &major, &minor );
1.18 + if( result == False ) {
1.19 + ERROR( "GLX not supported on display" );
1.20 + return FALSE;
1.21 }
1.22 +
1.23 + glx_version = (major*100) + minor;
1.24 +
1.25 #ifdef APPLE_BUILD
1.26 /* fbconfig is broken on at least the 10.5 GLX implementation */
1.27 glx_fbconfig_supported = FALSE;
.