Code example for GL10

Methods: glBindTexture, glColor4f, glDrawArrays, glFrontFace, glGetError, glTexCoordPointer, glVertexPointer

0
	 
	/** The draw method for the square with the GL context */ 
	public void draw(GL10 gl) {
		 
		// bind the previously generated texture 
		gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[thiscount]);
		 
		// Set the face rotation 
		gl.glFrontFace(GL10.GL_CW);
 
		gl.glColor4f(1.0f, 1.0f, 1.0f, opacity);
		 
		// Point to our vertex buffer 
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
		gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);
 
		// Draw the vertices as triangle strip 
		gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);
		 
		int err = gl.glGetError();
        if (err != 0) {
            Log.e("OpenGL error", GLU.gluErrorString(err));
        } 
         
		gl.glBindTexture(GL10.GL_TEXTURE_2D, 0);
	} 
	 
	/** 
	 * set count for textures, that was previously loaded 
	 * @param count - count