From: Ralf Jung Date: Fri, 21 Feb 2014 12:02:57 +0000 (+0100) Subject: test for invalid FBConfigs; explicitly request an FBConfig suited for a WINDOW X-Git-Url: https://git.ralfj.de/gltest.git/commitdiff_plain/c33e31157c4bfec02e8d0cabb78e3619fb1e581c?ds=inline test for invalid FBConfigs; explicitly request an FBConfig suited for a WINDOW --- diff --git a/glxbackend.cpp b/glxbackend.cpp index d636f67..a5c9e0c 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -32,6 +32,7 @@ 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, @@ -77,6 +78,9 @@ VisualID GLXBackend::initialize(Display *display) } // 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;