From 06ad8dcac2fac86d1f6715a51b50356a68ffe362 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 5 May 2013 11:39:16 +0200 Subject: [PATCH] More detailed error messages when failing to choose EGL configurations --- eglbackend.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.30.2