15

I'm trying to find out the maximum texture size for the original Motorola Droid. I believe the G1 has a maximum texture size of 512, but it would be nice if there was a more official way I could find out so I can build a proper tile system.

2 Answers 2

26

You can request the max texture size using glGetIntegerv:

int[] maxTextureSize = new int[1];
gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0);
Log.i("glinfo", "Max texture size = " + maxTextureSize[0]);
5
  • 5
    What is gl? GLES10? I tried to run it in onResume of my activity and it returns 0...
    – Yar
    Aug 27, 2013 at 18:36
  • 7
    You should make reference to Android's OpenGL ES implementation (android.opengl.GLES10); replace the second line with: GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, glInt, 0); Nov 13, 2013 at 18:25
  • That's a dynamically changed value? Mar 12, 2014 at 9:21
  • 4
    Note that the method returns 0 if there exists no OpenGL context. Adding android:hardwareAccelerated="true" to the application tag in the manifest may help, but I've noticed that this is no guarantee. Here[1] is an extensive answer that creates an OpenGL context before calling this method. [1]: stackoverflow.com/questions/26985858/…
    – Mathijs
    Apr 15, 2015 at 9:38
  • 3
    Always returns 0 for me as well.
    – jjxtra
    Oct 6, 2015 at 15:52
8

Also check out http://www.glbenchmark.com/ - it has an extensive database of OpenGL environment and performance details for mobile devices

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.