public TextureSquare(GL10 gl,Bitmap textureBitmap){
  ByteBuffer vbb=ByteBuffer.allocateDirect(squareCoords.length * 4);
  vbb.order(ByteOrder.nativeOrder());
  vertexBuffer=vbb.asFloatBuffer();
  vertexBuffer.put(squareCoords);
  vertexBuffer.position(0);
  ByteBuffer tbb=ByteBuffer.allocateDirect(textureCoords.length * 4);
  tbb.order(ByteOrder.nativeOrder());
  textureBuffer=tbb.asFloatBuffer();
  textureBuffer.put(textureCoords);
  textureBuffer.position(0);
  ByteBuffer dlb=ByteBuffer.allocateDirect(drawOrder.length * 2);
  dlb.order(ByteOrder.nativeOrder());
  drawListBuffer=dlb.asShortBuffer();
  drawListBuffer.put(drawOrder);
  drawListBuffer.position(0);
  textures=new int[1];
  gl.glGenTextures(1,textures,0);
  gl.glBindTexture(GL10.GL_TEXTURE_2D,textures[0]);
  GLUtils.texImage2D(GL10.GL_TEXTURE_2D,0,textureBitmap,0);
  gl.glTexParameterf(GL10.GL_TEXTURE_2D,GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_NEAREST);
  gl.glTexParameterf(GL10.GL_TEXTURE_2D,GL10.GL_TEXTURE_MAG_FILTER,GL10.GL_NEAREST);
  gl.glBindTexture(GL10.GL_TEXTURE_2D,0);
}

public TextureSquare ( GL10 gl , Bitmap textureBitmap ) { ByteBuffer vbb = ByteBuffer . allocateDirect ( squareCoords . length * 4 ) ; vbb . order ( ByteOrder . nativeOrder ( ) ) ; vertexBuffer = vbb . asFloatBuffer ( ) ; vertexBuffer . put ( squareCoords ) ; vertexBuffer . position ( 0 ) ; ByteBuffer tbb = ByteBuffer . allocateDirect ( textureCoords . length * 4 ) ; tbb . order ( ByteOrder . nativeOrder ( ) ) ; textureBuffer = tbb . asFloatBuffer ( ) ; textureBuffer . put ( textureCoords ) ; textureBuffer . position ( 0 ) ; ByteBuffer dlb = ByteBuffer . allocateDirect ( drawOrder . length * 2 ) ; dlb . order ( ByteOrder . nativeOrder ( ) ) ; drawListBuffer = dlb . asShortBuffer ( ) ; drawListBuffer . put ( drawOrder ) ; drawListBuffer . position ( 0 ) ; textures = new int [ 1 ] ; gl . glGenTextures ( 1 , textures , 0 ) ; gl . glBindTexture ( GL10 . GL_TEXTURE_2D , textures [ 0 ] ) ; GLUtils . texImage2D ( GL10 . GL_TEXTURE_2D , 0 , textureBitmap , 0 ) ; gl . glTexParameterf ( GL10 . GL_TEXTURE_2D , GL10 . GL_TEXTURE_MIN_FILTER , GL10 . GL_NEAREST ) ; gl . glTexParameterf ( GL10 . GL_TEXTURE_2D , GL10 . GL_TEXTURE_MAG_FILTER , GL10 . GL_NEAREST ) ; gl . glBindTexture ( GL10 . GL_TEXTURE_2D , 0 ) ; }
sets up the drawing object data for use in an opengl es context .
