From 958590beaa18208b13811f15e6e081a3ebb31202 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 12 Aug 2013 04:44:08 -0500 Subject: [PATCH] [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. --- .../src/org/dolphinemu/dolphinemu/PrefsFragment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/PrefsFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/PrefsFragment.java index 1263c03798..daf9aeb1c6 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/PrefsFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/PrefsFragment.java @@ -38,13 +38,18 @@ public class PrefsFragment extends PreferenceFragment { 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();