title: loading multiple textures openGL
body: <p>I just started using openGL I need to load allot of bitmaps for animation I can get it to work great for a few frames but run out of memory when I try to load all the frames How can I load just a few frames at a time?  This is the code I'm using to load the textures</p>
  
  <pre><code>public void loadGLTexture(GL10 gl, Context context) {
  
  
      Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.r1);
      Bitmap bitmap01 = Bitmap.createScaledBitmap(bitmap, 512, 512, false);
  
      Bitmap bitmap2 = BitmapFactory.decodeResource(context.getResources(),R.drawable.r2);
      Bitmap bitmap02 = Bitmap.createScaledBitmap(bitmap2, 512, 512, false);
  
      Bitmap bitmap3 = BitmapFactory.decodeResource(context.getResources(),R.drawable.r3);
      Bitmap bitmap03 = Bitmap.createScaledBitmap(bitmap3, 512, 512, false);
  
  
      try {
  
      bitmap = bitmap01;
          bitmap2 = bitmap02;
          bitmap3 = bitmap03;
      } finally {
      }
  
      //Generate there texture pointer
      gl.glGenTextures(3, textures, 0);
  
      //Create  Texture and bind it to texture 0
      gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
      GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
  
      //Create  Texture and bind it to texture 1
      gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
      GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap2, 0);
  
      //Create  Texture and bind it to texture 2
      gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[2]);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
      gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
      GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap3, 0);
  
  
      //Clean up
      bitmap.recycle();
      bitmap2.recycle();
      bitmap3.recycle();      
  }   
  </code></pre>
  
  <p>}</p>