Code example for GL10

Methods: glLoadIdentity, glMatrixMode, glViewport, gluPerspective

	 * @see android.opengl.GLSurfaceView.Renderer#onSurfaceChanged(javax. 
	 * microedition.khronos.opengles.GL10, int, int) 
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		// Sets the current view port to the new size. 
		gl.glViewport(0, 0, width, height);// OpenGL docs.
		// Select the projection matrix 
		gl.glMatrixMode(GL10.GL_PROJECTION);// OpenGL docs.
		// Reset the projection matrix 
		gl.glLoadIdentity();// OpenGL docs.
		// Calculate the aspect ratio of the window 
		GLU.gluPerspective(gl, 45.0f, (float) width / (float) height, 0.1f,
		// Select the modelview matrix 
		gl.glMatrixMode(GL10.GL_MODELVIEW);// OpenGL docs.
		// Reset the modelview matrix 
		gl.glLoadIdentity();// OpenGL docs.