Code example for GL10

Methods: glDisableClientState, glDrawElements, glEnableClientState, glFrontFace, glNormalPointer, glVertexPointer

0
	public void draw(GL10 gl, int filter) {
		//Bind the texture according to the set texture filter 
//		gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[filter]); 
 
		//Enable the vertex, texture and normal state 
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
//		gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); 
		gl.glEnableClientState(GL10.GL_NORMAL_ARRAY);
 
		//Set the face rotation 
		gl.glFrontFace(GL10.GL_CCW);
		 
//		gl.glTexEnvf(GL10.GL_FRONT, GL10.GL_AMBIENT_AND_DIFFUSE, GL10.GL_ADD); 
		 
		//Point to our buffers 
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
//		gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer); 
		gl.glNormalPointer(GL10.GL_FLOAT, 0, normalBuffer);
		 
		//Draw the vertices as triangles, based on the Index Buffer information 
		gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer);
		 
		//Disable the client state before leaving 
		gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
//		gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); 
		gl.glDisableClientState(GL10.GL_NORMAL_ARRAY);
	} 
 
	/** 
	 * Load the textures 
	 *