Code example for GLSurfaceView

Methods: setRenderer

0
        mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
 
        // Create our Preview view and set it as the content of our 
        // Activity 
        mRenderer = new MyRenderer();
        mGLSurfaceView = new GLSurfaceView(this);
        mGLSurfaceView.setRenderer(mRenderer);
        setContentView(mGLSurfaceView);
    } 
 
    @Override 
    protected void onResume() { 
        // Ideally a game should implement onResume() and onPause() 
        // to take appropriate action when the activity looses focus 
        super.onResume(); 
        mRenderer.start();
        mGLSurfaceView.onResume();
    } 
 
    @Override 
    protected void onPause() {