[Android] Parse integer ranges in the GLES3 info tab.

The info we retrieve will only ever have 2 elements given back to us.
This commit is contained in:
Lioncash 2014-01-22 12:28:46 -05:00
parent 36863bf7b8
commit 521aa631dc
2 changed files with 12 additions and 3 deletions

View File

@ -36,10 +36,10 @@ public final class GLES3InfoFragment extends ListFragment
new Limit("Renderer", GLES30.GL_RENDERER, Type.STRING),
new Limit("GLSL version", GLES30.GL_SHADING_LANGUAGE_VERSION, Type.STRING),
// GLES 2.0 Limits
//new Limit("Aliased Point Size", GLES20.GL_ALIASED_POINT_SIZE_RANGE, Type.INTEGER_RANGE),
//new Limit("Aliased Line Width ", GLES20.GL_ALIASED_LINE_WIDTH_RANGE, Type.INTEGER_RANGE),
new Limit("Aliased Point Size", GLES30.GL_ALIASED_POINT_SIZE_RANGE, Type.INTEGER_RANGE),
new Limit("Aliased Line Width ", GLES30.GL_ALIASED_LINE_WIDTH_RANGE, Type.INTEGER_RANGE),
new Limit("Max Texture Size", GLES30.GL_MAX_TEXTURE_SIZE, Type.INTEGER),
//new Limit("Viewport Dimensions", GLES20.GL_MAX_VIEWPORT_DIMS, Type.INTEGER_RANGE),
new Limit("Viewport Dimensions", GLES30.GL_MAX_VIEWPORT_DIMS, Type.INTEGER_RANGE),
new Limit("Subpixel Bits", GLES30.GL_SUBPIXEL_BITS, Type.INTEGER),
new Limit("Max Vertex Attributes", GLES30.GL_MAX_VERTEX_ATTRIBS, Type.INTEGER),
new Limit("Max Vertex Uniform Vectors", GLES30.GL_MAX_VERTEX_UNIFORM_VECTORS, Type.INTEGER),

View File

@ -48,9 +48,18 @@ final class Limit
public String GetValue(EGLHelper context)
{
if (type == Type.INTEGER)
{
return Integer.toString(context.glGetInteger(glEnum));
}
else if (type == Type.INTEGER_RANGE)
{
int[] data = new int[2];
context.getGL().glGetIntegerv(glEnum, data, 0);
return String.format("[%d, %d]", data[0], data[1]);
}
// If neither of the above type, assume it's a string.
return context.glGetString(glEnum);
}
}