Automated import from //branches/donutburger/...@142486,142486

This commit is contained in:
Jack Palevich
2009-03-24 22:49:05 -07:00
committed by The Android Open Source Project
parent 02e8d006b0
commit 46a1d90217
5 changed files with 5 additions and 29 deletions

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -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

View File

@@ -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);