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.

honk
  • 9,137
  • 11
  • 75
  • 83
jfisk
  • 6,125
  • 20
  • 77
  • 113

2 Answers2

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]);
svdree
  • 13,298
  • 4
  • 28
  • 21
  • 5
    What is gl? GLES10? I tried to run it in onResume of my activity and it returns 0... – Yar Aug 27 '13 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);` – Paul Lammertsma Nov 13 '13 at 18:25
  • That's a dynamically changed value? – Sergey Shustikov Mar 12 '14 at 09: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]: http://stackoverflow.com/questions/26985858/gles10-glgetintegerv-returns-0-in-lollipop-only – Mathijs Apr 15 '15 at 09:38
  • 3
    Always returns 0 for me as well. – jjxtra Oct 06 '15 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

ryanm
  • 2,979
  • 18
  • 22