Code example for GL10

Methods: glClear, glLoadIdentity, glScalef, glTranslatef

0
		gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
	} 
 
	public void onDrawFrame(GL10 gl) {
			// Clears the screen and depth buffer. 
		gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
		// Replace the current matrix with the identity matrix 
		gl.glLoadIdentity();
		// Translates 4 units into the screen. 
		gl.glTranslatef(x, y, 0.0f);
		gl.glScalef(mBoxSize, mBoxSize, mBoxSize);
		// Draw our square. 
		square.draw(gl);
	} 
 
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		w = width;
		h = height;
 
		gl.glViewport(0, 0, width, height);