Automated import from //branches/donutburger/...@142486,142486
This commit is contained in:
committed by
The Android Open Source Project
parent
02e8d006b0
commit
46a1d90217
@@ -34,6 +34,10 @@ public class TranslucentGLSurfaceViewActivity extends Activity {
|
|||||||
// Create our Preview view and set it as the content of our
|
// Create our Preview view and set it as the content of our
|
||||||
// Activity
|
// Activity
|
||||||
mGLSurfaceView = new GLSurfaceView(this);
|
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
|
// Tell the cube renderer that we want to render a translucent version
|
||||||
// of the cube:
|
// of the cube:
|
||||||
mGLSurfaceView.setRenderer(new CubeRenderer(true));
|
mGLSurfaceView.setRenderer(new CubeRenderer(true));
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class TriangleActivity extends Activity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
mGLView = new GLSurfaceView(this);
|
mGLView = new GLSurfaceView(this);
|
||||||
|
mGLView.setEGLConfigChooser(false);
|
||||||
mGLView.setRenderer(new TriangleRenderer(this));
|
mGLView.setRenderer(new TriangleRenderer(this));
|
||||||
setContentView(mGLView);
|
setContentView(mGLView);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,16 +44,6 @@ public class TriangleRenderer implements GLSurfaceView.Renderer{
|
|||||||
mTriangle = new Triangle();
|
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) {
|
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
|
||||||
/*
|
/*
|
||||||
* By default, OpenGL enables features that improve quality
|
* By default, OpenGL enables features that improve quality
|
||||||
|
|||||||
@@ -74,15 +74,6 @@ class KubeRenderer implements GLSurfaceView.Renderer {
|
|||||||
mWorld.draw(gl);
|
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) {
|
public void onSurfaceChanged(GL10 gl, int width, int height) {
|
||||||
gl.glViewport(0, 0, width, height);
|
gl.glViewport(0, 0, width, height);
|
||||||
|
|
||||||
|
|||||||
@@ -89,16 +89,6 @@ public class CompassActivity extends Activity implements Renderer, SensorEventLi
|
|||||||
mSensorManager.unregisterListener(this);
|
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) {
|
public void onDrawFrame(GL10 gl) {
|
||||||
/*
|
/*
|
||||||
* Usually, the first thing one might want to do is to clear
|
* Usually, the first thing one might want to do is to clear
|
||||||
|
|||||||
Reference in New Issue
Block a user