diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-04-22 16:13:59 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-04-22 19:55:59 +0300 |
commit | c6726616b168d898b522f95d18544cedda202eba (patch) | |
tree | 70eace688d52d7a4980ce565dcf4c20850b3c757 | |
parent | 290e32736bc92569ad5b4626654505c459591326 (diff) |
kmscube: check errors
-rw-r--r-- | kmscube/cube-egl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kmscube/cube-egl.cpp b/kmscube/cube-egl.cpp index 4213536..d2bc7e3 100644 --- a/kmscube/cube-egl.cpp +++ b/kmscube/cube-egl.cpp @@ -63,7 +63,8 @@ EglState::EglState(void *native_display) m_context = eglCreateContext(m_display, m_config, EGL_NO_CONTEXT, context_attribs); FAIL_IF(!m_context, "failed to create context"); - eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, m_context); + EGLBoolean ok = eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, m_context); + FAIL_IF(!ok, "eglMakeCurrent() failed"); } EglState::~EglState() @@ -86,10 +87,12 @@ EglSurface::~EglSurface() void EglSurface::make_current() { - eglMakeCurrent(egl.display(), esurface, esurface, egl.context()); + EGLBoolean ok = eglMakeCurrent(egl.display(), esurface, esurface, egl.context()); + FAIL_IF(!ok, "eglMakeCurrent() failed"); } void EglSurface::swap_buffers() { - eglSwapBuffers(egl.display(), esurface); + EGLBoolean ok = eglSwapBuffers(egl.display(), esurface); + FAIL_IF(!ok, "eglMakeCurrent() failed"); } |