From: Ralf Jung Date: Sun, 5 May 2013 09:39:16 +0000 (+0200) Subject: More detailed error messages when failing to choose EGL configurations X-Git-Url: https://git.ralfj.de/gltest.git/commitdiff_plain/06ad8dcac2fac86d1f6715a51b50356a68ffe362?ds=inline More detailed error messages when failing to choose EGL configurations --- diff --git a/eglbackend.cpp b/eglbackend.cpp index e2f9787..c5d5bcb 100644 --- a/eglbackend.cpp +++ b/eglbackend.cpp @@ -91,8 +91,13 @@ VisualID EGLBackend::initialize(Display *xDisplay) // 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"); + } + if (count == 0) { + fprintf(stderr, "Found no matching EGL configuration\n"); + exit(1); + } config = configs[0]; } // return visual ID