Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Fix OpenGL ES 3 detection on Nexus 10. Nexus 10 defaults to…
… GLES1 context when not specified while Adreno defaults to GLES2. Thanks to Jeremy D Miller for noticing and finding out why this was failing.
  • Loading branch information
Sonicadvance1 committed Aug 12, 2013
1 parent 4c22e12 commit 958590b
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -38,13 +38,18 @@ public VersionCheck() {
EGL10.EGL_RENDERABLE_TYPE, 4,
EGL10.EGL_NONE
};
int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
int[] ctx_attribs = new int[] {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL10.EGL_NONE
};

// No error checking performed, minimum required code to elucidate logic
mEGL = (EGL10) EGLContext.getEGL();
mEGLDisplay = mEGL.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
mEGL.eglInitialize(mEGLDisplay, version);
mEGLConfig = chooseConfig(); // Choosing a config is a little more complicated
mEGLContext = mEGL.eglCreateContext(mEGLDisplay, mEGLConfig, EGL10.EGL_NO_CONTEXT, null);
mEGLContext = mEGL.eglCreateContext(mEGLDisplay, mEGLConfig, EGL10.EGL_NO_CONTEXT, ctx_attribs);
mEGLSurface = mEGL.eglCreatePbufferSurface(mEGLDisplay, mEGLConfig, attribList);
mEGL.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext);
mGL = (GL10) mEGLContext.getGL();
Expand Down

0 comments on commit 958590b

Please sign in to comment.