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

GLSurfaceViewActivity

public class GLSurfaceViewActivity extends android.app.Activity
Wrapper activity demonstrating the use of {@link GLSurfaceView}, a view that uses OpenGL drawing into a dedicated surface.

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);
        mGLSurfaceView.setRenderer(new CubeRenderer(false));
        setContentView(mGLSurfaceView);
    
protected voidonPause()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onPause();
        mGLSurfaceView.onPause();
    
protected voidonResume()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onResume();
        mGLSurfaceView.onResume();