diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-03-27 16:25:29 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-03-27 16:38:21 -0700 |
| commit | dce2ef51f242460df7e8526cb0625f8f16983a24 (patch) | |
| tree | 2022c9931bf59c789e23376e5853fd50e1b9c5b8 /src/egl.cpp | |
| parent | e2b4bae92c27e13d7f8ddba92950445a85a363cb (diff) | |
egl: Check for error condition before creating a context
Diffstat (limited to 'src/egl.cpp')
| -rw-r--r-- | src/egl.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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"); |