I am trying to use the EGL context of bwteen 2 GLSurfaceViews with the following code:
createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { EGLContext shared = ...; // a cached egl context int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; EGLContext context = egl.eglCreateContext(display, eglConfig, shared == null ? EGL10.EGL_NO_CONTEXT : shared, attrib_list); return context; } }
The code works on most Android phones (OS> = 2.2), but failed on all tested tablets.
01-12 18: 33: 35.381: E / AndroidRuntime (12171): FATAL EXCEPTION: GLThread 11
01-12 18: 33: 35.381: E / AndroidRuntime (12171): java.lang.RuntimeException: eglMakeCurrent failed: EGL_BAD_ACCESS
01-12 18: 33: 35.381: E / AndroidRuntime (12171): at android.opengl.GLSurfaceView $ EglHelper.throwEglException (GLSurfaceView.java:1146)
Since I declared LOCAL_LDLIBS: = -lGLESv2, EGL is a 2.0 context.
Why this failed on tablets (xoom, galaxy, lg, sony, etc.)
Any understanding is understood.
source share