title: How to determine the texture memory limits for an Android device in code?
body: <p>Here's the situation: I have a two images that are over 1024 in width and end up scaling up to 2048 as a power-of-2. This works fine on almost all tested Android devices, except for the HTC Eris and HTC Hero which fail and render just an empty white rectangle.</p>
  
  <p>What I'd like to do is add a check to disable a feature that uses the large textures. So basically I just need a way to determine if the device can support the high-res images, with a simple boolean result.</p>
  
  <p>I've found several similar questions online but none that answer with a way to do this.</p>
  
  <p><strong>The Solution (as per Tim's answer):</strong></p>
  
  <p>I was able to capture this info inside the <code>onSurfaceCreated()</code> method of my <code>GLSurfaceView.Renderer</code> class, then test against it:</p>
  
  <pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config)
  {
      IntBuffer textureLimit = IntBuffer.allocate(1);
      gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, textureLimit);
      this.mTextureLimit = textureLimit.get(0);
  }
  </code></pre>