Code example for FloatBuffer

Methods: clear, position, put

0
		 */ 
		this.vertexBuffer.clear();
		this.vertexBuffer.put(this.vertices);
		this.vertexBuffer.position(0);
 
		this.textureBuffer.clear();
		this.textureBuffer.put(this.texture);
		this.textureBuffer.position(0);
 
		// 
 
		this.indexBuffer.clear();
		this.indexBuffer.put(GLGraphic.indices);
		this.indexBuffer.position(0);
 
		GLGraphic.gl.glTranslatef(offsetX, offsetY, 0);
		GLGraphic.gl.glRotatef(-90.0f, 0.0f, 0.0f, 1.0f); // X
 
		// gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); 
		GLGraphic.gl.glBindTexture(GL10.GL_TEXTURE_2D,
				GLGraphic.loaded.get(this.name)[0]);
 
		// Point to our buffers 
		GLGraphic.gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
		GLGraphic.gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
 
		// Set the face rotation 
		GLGraphic.gl.glFrontFace(GL10.GL_CCW);
 
		// Enable the vertex and texture state 
		GLGraphic.gl.glVertexPointer(3, GL10.GL_FLOAT, 0, this.vertexBuffer);
		GLGraphic.gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, this.textureBuffer);
 
		// Draw the vertices as triangles, based on the Index Buffer information 
		GLGraphic.gl.glDrawElements(GL10.GL_TRIANGLES,
				GLGraphic.indices.length, GL10.GL_UNSIGNED_BYTE,
				this.indexBuffer);