diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.java b/samples/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.java index 750a47ba7..a0bad4bc9 100644 --- a/samples/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.java +++ b/samples/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.java @@ -34,6 +34,10 @@ public class TranslucentGLSurfaceViewActivity extends Activity { // Create our Preview view and set it as the content of our // Activity mGLSurfaceView = new GLSurfaceView(this); + // We want an 8888 pixel format because that's required for + // a translucent window. + // And we want a depth buffer. + mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); // Tell the cube renderer that we want to render a translucent version // of the cube: mGLSurfaceView.setRenderer(new CubeRenderer(true)); diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleActivity.java b/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleActivity.java index 59f3c6cf8..e5b06f426 100644 --- a/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleActivity.java +++ b/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleActivity.java @@ -26,6 +26,7 @@ public class TriangleActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGLView = new GLSurfaceView(this); + mGLView.setEGLConfigChooser(false); mGLView.setRenderer(new TriangleRenderer(this)); setContentView(mGLView); } diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.java b/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.java index 451b927a9..e5299b332 100644 --- a/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.java +++ b/samples/ApiDemos/src/com/example/android/apis/graphics/TriangleRenderer.java @@ -44,16 +44,6 @@ public class TriangleRenderer implements GLSurfaceView.Renderer{ mTriangle = new Triangle(); } - public int[] getConfigSpec() { - // We don't need a depth buffer, and don't care about our - // color depth. - int[] configSpec = { - EGL10.EGL_DEPTH_SIZE, 0, - EGL10.EGL_NONE - }; - return configSpec; - } - public void onSurfaceCreated(GL10 gl, EGLConfig config) { /* * By default, OpenGL enables features that improve quality diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/kube/KubeRenderer.java b/samples/ApiDemos/src/com/example/android/apis/graphics/kube/KubeRenderer.java index 252f566f9..9977041a2 100644 --- a/samples/ApiDemos/src/com/example/android/apis/graphics/kube/KubeRenderer.java +++ b/samples/ApiDemos/src/com/example/android/apis/graphics/kube/KubeRenderer.java @@ -74,15 +74,6 @@ class KubeRenderer implements GLSurfaceView.Renderer { mWorld.draw(gl); } - public int[] getConfigSpec() { - // Need a depth buffer, don't care about color depth. - int[] configSpec = { - EGL10.EGL_DEPTH_SIZE, 16, - EGL10.EGL_NONE - }; - return configSpec; - } - public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); diff --git a/samples/Compass/src/com/example/android/compass/CompassActivity.java b/samples/Compass/src/com/example/android/compass/CompassActivity.java index c4b956675..74f3bc71d 100644 --- a/samples/Compass/src/com/example/android/compass/CompassActivity.java +++ b/samples/Compass/src/com/example/android/compass/CompassActivity.java @@ -89,16 +89,6 @@ public class CompassActivity extends Activity implements Renderer, SensorEventLi mSensorManager.unregisterListener(this); } - public int[] getConfigSpec() { - // We want a depth buffer, don't care about the - // details of the color buffer. - int[] configSpec = { - EGL10.EGL_DEPTH_SIZE, 16, - EGL10.EGL_NONE - }; - return configSpec; - } - public void onDrawFrame(GL10 gl) { /* * Usually, the first thing one might want to do is to clear