From 05c62e5b524edb8eb593e41bd44dc0259c213e27 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Thu, 6 Nov 2014 19:50:14 +0200 Subject: [PATCH] Explicitly enable VSYNC, to fix video output on Nvidia Shield --- project/java/GLSurfaceView_SDL.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/project/java/GLSurfaceView_SDL.java b/project/java/GLSurfaceView_SDL.java index af7ccbd20..f38eec19a 100644 --- a/project/java/GLSurfaceView_SDL.java +++ b/project/java/GLSurfaceView_SDL.java @@ -32,6 +32,8 @@ import javax.microedition.khronos.egl.EGLSurface; import javax.microedition.khronos.opengles.GL; import javax.microedition.khronos.opengles.GL10; +import android.opengl.EGL14; // Android 4.2 or newer + import android.content.Context; import android.util.AttributeSet; import android.util.Log; @@ -919,6 +921,9 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) { + EGL14.eglSwapInterval(mEglDisplay, 1); + } GL gl = mEglContext.getGL(); if (mGLWrapper != null) {