Code example for GL10

Methods: gluPerspectiveglLoadIdentityglMatrixModeglViewport

	public void onSurfaceChanged(GL10 gl, int width, int height) {
		if(height == 0) { 						//Prevent A Divide By Zero By
			height = 1; 						//Making Height Equal One
		gl.glViewport(0, 0, width, height); 	//Reset The Current Viewport
		gl.glMatrixMode(GL10.GL_PROJECTION); 	//Select The Projection Matrix
		gl.glLoadIdentity(); 					//Reset The Projection Matrix
		//Calculate The Aspect Ratio Of The Window 
		GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f);
		gl.glMatrixMode(GL10.GL_MODELVIEW); 	//Select The Modelview Matrix
		gl.glLoadIdentity(); 					//Reset The Modelview Matrix
/* ***** Listener Events ( NEW ) ***** */	 
	 * Override the key listener to receive keyUp events. 
Contextual code suggestions in your IDE  Get Codota for Java