More detailed error messages when failing to choose EGL configurations
authorRalf Jung <post@ralfj.de>
Sun, 5 May 2013 09:39:16 +0000 (11:39 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 5 May 2013 09:39:16 +0000 (11:39 +0200)
eglbackend.cpp

index e2f97879098643780a91d8b1a6f3e441ee1c807f..c5d5bcb126fe04d605676f558a4201608f2626e5 100644 (file)
@@ -91,8 +91,13 @@ VisualID EGLBackend::initialize(Display *xDisplay)
                // get an appropriate config
                EGLConfig configs[1];
                EGLint count;
                // get an appropriate config
                EGLConfig configs[1];
                EGLint count;
-               if (eglChooseConfig(display, config_attribs, configs, 1, &count) == EGL_FALSE || count == 0)
+               if (eglChooseConfig(display, config_attribs, configs, 1, &count) == EGL_FALSE){
                        exitEglError("Failed to choose config");
                        exitEglError("Failed to choose config");
+               }
+               if (count == 0) {
+                       fprintf(stderr, "Found no matching EGL configuration\n");
+                       exit(1);
+               }
                config = configs[0];
        }
        // return visual ID
                config = configs[0];
        }
        // return visual ID