diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index 6878548..b52f5f0 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -935,7 +935,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback mEglDisplay, mEglConfig, holder); if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) { - throw new RuntimeException("createWindowSurface failed"); + throwEglException("createWindowSurface"); } /* @@ -943,7 +943,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback * the context is current and bound to a surface. */ if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) { - throw new RuntimeException("eglMakeCurrent failed."); + throwEglException("eglMakeCurrent"); } GL gl = mEglContext.getGL(); @@ -1002,6 +1002,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } } + private void throwEglException(String function) { + throw new RuntimeException(function + " failed: " + mEgl.eglGetError()); + } + EGL10 mEgl; EGLDisplay mEglDisplay; EGLSurface mEglSurface; |