From dce2ef51f242460df7e8526cb0625f8f16983a24 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Thu, 27 Mar 2014 16:25:29 -0700 Subject: egl: Check for error condition before creating a context --- src/egl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/egl.cpp') diff --git a/src/egl.cpp b/src/egl.cpp index 5f04110..66b4501 100644 --- a/src/egl.cpp +++ b/src/egl.cpp @@ -42,7 +42,7 @@ createEGLContextAndWindow(egl_state_t *state, int width, int height) } state->window = XCreateSimpleWindow (state->dpy, DefaultRootWindow (state->dpy), - 0, 0, + 200, 200, width, height, 0, BlackPixel (state->dpy, DefaultRootWindow (state->dpy)), @@ -70,6 +70,11 @@ createEGLContextAndWindow(egl_state_t *state, int width, int height) return false; } + if (!config or num < 1) { + warnx ("No valid EGL configuration could be found\n"); + return false; + } + state->egl_context = eglCreateContext (state->egl_display, config, NULL, ctx_attr); if (state->egl_context == EGL_NO_CONTEXT) { warnx ("Cannot create EGL context\n"); -- cgit v1.3.1-4-g156e