test for invalid FBConfigs; explicitly request an FBConfig suited for a WINDOW
authorRalf Jung <post@ralfj.de>
Fri, 21 Feb 2014 12:02:57 +0000 (13:02 +0100)
committerRalf Jung <post@ralfj.de>
Fri, 21 Feb 2014 12:02:57 +0000 (13:02 +0100)
glxbackend.cpp

index d636f677fc29b75e11236a436bf998344510163b..a5c9e0c84911384d693c98d4a8c9680da0dec6ad 100644 (file)
@@ -32,6 +32,7 @@
 static int configAttribs[] =                                             
 {
        GLX_RENDER_TYPE, GLX_RGBA_BIT,
 static int configAttribs[] =                                             
 {
        GLX_RENDER_TYPE, GLX_RGBA_BIT,
+       GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
        GLX_DOUBLEBUFFER, True,
        GLX_RED_SIZE, 4,
        GLX_GREEN_SIZE, 4,
        GLX_DOUBLEBUFFER, True,
        GLX_RED_SIZE, 4,
        GLX_GREEN_SIZE, 4,
@@ -77,6 +78,9 @@ VisualID GLXBackend::initialize(Display *display)
        }
        // return visual ID
        XVisualInfo *vi = glXGetVisualFromFBConfig(display, config);
        }
        // return visual ID
        XVisualInfo *vi = glXGetVisualFromFBConfig(display, config);
+       if (vi== NULL) {
+               die("The GLXFBConfig I got is invalid\n");
+       }
        VisualID visualid = vi->visualid;
        XFree(vi);
        return visualid;
        VisualID visualid = vi->visualid;
        XFree(vi);
        return visualid;