Fix OpenGL context creation on PowerVR

This commit is contained in:
Henrik Rydgard 2013-10-10 23:55:59 +02:00
parent 36bc59f006
commit b16b67d8b6
3 changed files with 6 additions and 1 deletions

View File

@ -286,6 +286,8 @@ public class NativeActivity extends Activity {
NativeApp.audioInit();
mGLSurfaceView = new NativeGLView(this);
mGLSurfaceView.setEGLContextClientVersion(2);
// Setup the GLSurface and ask android for the correct
// Number of bits for r, g, b, a, depth and stencil components

View File

@ -10,6 +10,8 @@ import android.util.Log;
public class NativeEGLConfigChooser implements EGLConfigChooser {
private static final String TAG = "NativeEGLConfigChooser";
private static final int EGL_OPENGL_ES2_BIT = 4;
private class ConfigAttribs {
EGLConfig config;
public int red;
@ -68,6 +70,7 @@ public class NativeEGLConfigChooser implements EGLConfigChooser {
EGL10.EGL_DEPTH_SIZE, 16,
EGL10.EGL_STENCIL_SIZE, 0,
EGL10.EGL_SURFACE_TYPE, EGL10.EGL_WINDOW_BIT,
EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL10.EGL_NONE
};

View File

@ -27,7 +27,7 @@ public class NativeGLView extends GLSurfaceView implements SensorEventListener,
public NativeGLView(NativeActivity activity) {
super(activity);
setEGLContextClientVersion(2);
/*
if (Build.VERSION.SDK_INT >= 11) {
try {