Code example for GL10

Methods: glClearglLoadIdentityglTranslatef

0
	/** 
	 * Here we do our drawing 
	 */ 
	public void onDrawFrame(GL10 gl) {
		// Clear Screen And Depth Buffer 
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		gl.glLoadIdentity(); // Reset The Current Modelview Matrix
 
		gl.glTranslatef(0.0f, -1.2f, -6.0f); // Move down 1.2 Unit And Into The Screen 6.0
		square.draw(gl); // Draw the square
 
		gl.glTranslatef(0.0f, 2.5f, 0.0f); // Move up 2.5 Units
		triangle.draw(gl); // Draw the triangle
 
	} 
 
	/** 
	 * If the surface changes, reset the view 
	 */ 
	public void onSurfaceChanged(GL10 gl, int width, int height) {