From c6726616b168d898b522f95d18544cedda202eba Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 22 Apr 2016 16:13:59 +0300 Subject: kmscube: check errors --- kmscube/cube-egl.cpp | 9 ++++++--- 1 file 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"); } -- cgit v1.2.3