Code example for GL10

Methods: glClear, glEnableClientState, glLoadIdentity, glLoadMatrixf, glMatrixMode, glRotatef, glTranslatef

0
       * Usually, the first thing one might want to do is to clear 
       * the screen. The most efficient way of doing this is to use 
       * glClear(). 
       */ 
 
      gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
 
      /* 
       * Now we're ready to draw some 3D objects 
       */ 
 
      gl.glMatrixMode(GL10.GL_MODELVIEW);
      gl.glLoadIdentity();
 
      // Load our rotation matrix 
      gl.glLoadMatrixf(
          FloatBuffer.wrap(mRotationMatrix.getArray())
          ); 
 
      //gl.glTranslatef(0, 0, -3.0f); 
      gl.glTranslatef(-3.0f, 0, 0);
 
      gl.glRotatef(mAngleX, 0, 1, 0);
      gl.glRotatef(mAngleY, 1, 0, 0);
 
      gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
      gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
 
      mCube.draw(gl);
    } 
 
    public void onSurfaceChanged(GL10 gl, int width, int height) {
      gl.glViewport(0, 0, width, height);