diff options
3 files changed, 12 insertions, 3 deletions
diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java index 32ba11f95..ce924e289 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20.java @@ -44,6 +44,9 @@ public class GLSurfaceView20 extends GLSurfaceView { static String TAG = "GL2JNIView";
private static final boolean DEBUG = false;
+ final static int EGL_CONTEXT_PRIORITY_LEVEL_IMG = 0x3100;
+ final static int EGL_CONTEXT_PRIORITY_LOW_IMG = 0x3103;
+
final ResolutionStrategy resolutionStrategy;
static int targetGLESVersion;
@@ -140,7 +143,8 @@ public class GLSurfaceView20 extends GLSurfaceView { public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
Log.w(TAG, "creating OpenGL ES " + GLSurfaceView20.targetGLESVersion + ".0 context");
checkEglError("Before eglCreateContext "+targetGLESVersion, egl);
- int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, GLSurfaceView20.targetGLESVersion, EGL10.EGL_NONE};
+ int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, GLSurfaceView20.targetGLESVersion,
+ EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_LOW_IMG, EGL10.EGL_NONE};
EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
boolean success = checkEglError("After eglCreateContext "+targetGLESVersion, egl);
diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java index b1239cea8..84a456a2b 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceView20API18.java @@ -135,7 +135,9 @@ public class GLSurfaceView20API18 extends GLSurfaceViewAPI18 { public EGLContext createContext (EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { Log.w(TAG, "creating OpenGL ES 2.0 context"); checkEglError("Before eglCreateContext", egl); - int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE}; + int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, + GLSurfaceView20.EGL_CONTEXT_PRIORITY_LEVEL_IMG, GLSurfaceView20.EGL_CONTEXT_PRIORITY_LOW_IMG, + EGL10.EGL_NONE}; EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); checkEglError("After eglCreateContext", egl); return context; diff --git a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java index dfac62a15..58d130bd6 100644 --- a/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java +++ b/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/surfaceview/GLSurfaceViewAPI18.java @@ -778,8 +778,11 @@ public class GLSurfaceViewAPI18 extends SurfaceView implements SurfaceHolder.Cal private int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig config) { + final int EGL_CONTEXT_PRIORITY_LEVEL_IMG = 0x3100; + final int EGL_CONTEXT_PRIORITY_LOW_IMG = 0x3103; int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, mEGLContextClientVersion, - EGL10.EGL_NONE }; + GLSurfaceView20.EGL_CONTEXT_PRIORITY_LEVEL_IMG, GLSurfaceView20.EGL_CONTEXT_PRIORITY_LOW_IMG, + EGL10.EGL_NONE}; return egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, mEGLContextClientVersion != 0 ? attrib_list : null); |