Search
lxdream.org :: lxdream/src/drivers/video_glx.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_glx.c
changeset 606:23029426ab8f
prev586:2a3ba82cf243
next635:76c63aac3590
next653:3202ff01d48e
author nkeynes
date Fri Jan 25 05:52:51 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Detect if we failed to obtain a GLX visual and abort rather than crashing
file annotate diff log raw
1.1 --- a/src/drivers/video_glx.c Tue Jan 15 20:50:23 2008 +0000
1.2 +++ b/src/drivers/video_glx.c Fri Jan 25 05:52:51 2008 +0000
1.3 @@ -32,7 +32,7 @@
1.4 static gboolean glsl_loaded = FALSE;
1.5
1.6 static int glx_version = 100;
1.7 -static XVisualInfo *glx_visual;
1.8 +static XVisualInfo *glx_visual = NULL;
1.9 static GLXFBConfig glx_fbconfig;
1.10 static GLXContext glx_context = NULL;
1.11 static gboolean glx_is_initialized = FALSE;
1.12 @@ -100,7 +100,7 @@
1.13 glx_pbuffer_supported = (glx_version >= 103 ||
1.14 isServerGLXExtensionSupported(display, screen,
1.15 "GLX_SGIX_pbuffer") );
1.16 -
1.17 +
1.18 if( glx_fbconfig_supported ) {
1.19 int nelem;
1.20 int fb_attribs[] = { GLX_DRAWABLE_TYPE,
1.21 @@ -125,6 +125,11 @@
1.22 int attribs[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, 0 };
1.23 glx_visual = glXChooseVisual( display, screen, attribs );
1.24 }
1.25 +
1.26 + if( glx_visual == NULL ) {
1.27 + return FALSE;
1.28 + }
1.29 +
1.30 glx_is_initialized = TRUE;
1.31 return TRUE;
1.32 }
.