title: Is there a way to pass context into onDrawFrame(GL10 gl)?
body: <p>I am designing a game in Open GLES on Android in Java.</p>
  
  <p>Obviously I am using lots of textures and soon I will run out of memory.</p>
  
  <p>I am quite new to Android and Java, but I figured that the easiest way to go round this problem is to destroy the objects with bitmaps, which I don't need at the moment, let the garbage collector reclaim the memory which they occupied, then re-create those objects at the late stage when I again need the respective textures.</p>
  
  <p>Something like this:</p>
  
  <pre><code>background = null;
  </code></pre>
  
  <p>then when I need the textures in background object:</p>
  
  <pre><code>background = new Background(context);
  </code></pre>
  
  <p>seems pretty straighforward, except that is, that the context (which I need for my class background to function, as it loads the textures from it via BitmapFactory) is not passed into <code>onDrawFrame(GL10 gl)</code> function where my main game loop is and where I need it!</p>
  
  <p>If I try to add context as a second parameter after GL10 gl, I get an error - this does not seem to be possible.</p>
  
  <p>Does anybody know how to pass context into onDrawFrame, or other way how to clear the context objects from memory and then reinstate them again?</p>