Automated import from //branches/cupcake/...@142485,142485
This commit is contained in:
committed by
The Android Open Source Project
parent
4595b7960d
commit
bea7f769d8
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user