FileDocCategorySizeDatePackage
TranslucentGLSurfaceViewActivity.javaAPI DocAndroid 1.5 API2038Wed May 06 22:41:08 BST 2009com.example.android.apis.graphics

TranslucentGLSurfaceViewActivity

public class TranslucentGLSurfaceViewActivity extends android.app.Activity
Wrapper activity demonstrating the use of {@link GLSurfaceView} to display translucent 3D graphics.

Fields Summary
private android.opengl.GLSurfaceView
mGLSurfaceView
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        // 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));
        // Use a surface format with an Alpha channel:
        mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
        setContentView(mGLSurfaceView);
    
protected voidonPause()

        super.onPause();
        mGLSurfaceView.onPause();
    
protected voidonResume()

        super.onResume();
        mGLSurfaceView.onResume();