development
Revisão | 46a1d902174efe99c6b4048d6dfa78ef7916f937 (tree) |
---|---|
Hora | 2009-03-25 14:49:05 |
Autor | Jack Palevich <> |
Commiter | The Android Open Source Project |
Automated import from //branches/donutburger/...@142486,142486
@@ -34,6 +34,10 @@ public class TranslucentGLSurfaceViewActivity extends Activity { | ||
34 | 34 | // Create our Preview view and set it as the content of our |
35 | 35 | // Activity |
36 | 36 | mGLSurfaceView = new GLSurfaceView(this); |
37 | + // We want an 8888 pixel format because that's required for | |
38 | + // a translucent window. | |
39 | + // And we want a depth buffer. | |
40 | + mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); | |
37 | 41 | // Tell the cube renderer that we want to render a translucent version |
38 | 42 | // of the cube: |
39 | 43 | mGLSurfaceView.setRenderer(new CubeRenderer(true)); |
@@ -26,6 +26,7 @@ public class TriangleActivity extends Activity { | ||
26 | 26 | protected void onCreate(Bundle savedInstanceState) { |
27 | 27 | super.onCreate(savedInstanceState); |
28 | 28 | mGLView = new GLSurfaceView(this); |
29 | + mGLView.setEGLConfigChooser(false); | |
29 | 30 | mGLView.setRenderer(new TriangleRenderer(this)); |
30 | 31 | setContentView(mGLView); |
31 | 32 | } |
@@ -44,16 +44,6 @@ public class TriangleRenderer implements GLSurfaceView.Renderer{ | ||
44 | 44 | mTriangle = new Triangle(); |
45 | 45 | } |
46 | 46 | |
47 | - public int[] getConfigSpec() { | |
48 | - // We don't need a depth buffer, and don't care about our | |
49 | - // color depth. | |
50 | - int[] configSpec = { | |
51 | - EGL10.EGL_DEPTH_SIZE, 0, | |
52 | - EGL10.EGL_NONE | |
53 | - }; | |
54 | - return configSpec; | |
55 | - } | |
56 | - | |
57 | 47 | public void onSurfaceCreated(GL10 gl, EGLConfig config) { |
58 | 48 | /* |
59 | 49 | * By default, OpenGL enables features that improve quality |
@@ -74,15 +74,6 @@ class KubeRenderer implements GLSurfaceView.Renderer { | ||
74 | 74 | mWorld.draw(gl); |
75 | 75 | } |
76 | 76 | |
77 | - public int[] getConfigSpec() { | |
78 | - // Need a depth buffer, don't care about color depth. | |
79 | - int[] configSpec = { | |
80 | - EGL10.EGL_DEPTH_SIZE, 16, | |
81 | - EGL10.EGL_NONE | |
82 | - }; | |
83 | - return configSpec; | |
84 | - } | |
85 | - | |
86 | 77 | public void onSurfaceChanged(GL10 gl, int width, int height) { |
87 | 78 | gl.glViewport(0, 0, width, height); |
88 | 79 |
@@ -89,16 +89,6 @@ public class CompassActivity extends Activity implements Renderer, SensorEventLi | ||
89 | 89 | mSensorManager.unregisterListener(this); |
90 | 90 | } |
91 | 91 | |
92 | - public int[] getConfigSpec() { | |
93 | - // We want a depth buffer, don't care about the | |
94 | - // details of the color buffer. | |
95 | - int[] configSpec = { | |
96 | - EGL10.EGL_DEPTH_SIZE, 16, | |
97 | - EGL10.EGL_NONE | |
98 | - }; | |
99 | - return configSpec; | |
100 | - } | |
101 | - | |
102 | 92 | public void onDrawFrame(GL10 gl) { |
103 | 93 | /* |
104 | 94 | * Usually, the first thing one might want to do is to clear |