8

What is the different beetween this, and how i can query what is supported by the actual phone? (GL10 or GL11)

i have a HTC Legend, that is supported GL11 or not? Or hero...etc... ?

4 Answers 4

8

There's an API for that:

public int getGLVersion() { ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo info = am.getDeviceConfigurationInfo(); return info.reqGlEsVersion; } 

The upper order 16 bits represent the major version and the lower order 16 bits the minor version. For more information, visit this link. So:

  • For OpenGLES 1.1, getGLVersion() == 0x00010001
  • For OpenGLES 2.0, getGLVersion() == 0x00020000

If you want the string representation (for display), call ConfigurationInfo.getGlEsVersion()

Sign up to request clarification or add additional context in comments.

2 Comments

This does not return what the hardware can support, but what the application has requested in AndroidManifest.xml
No, 2.0 Means GLES20, 1.1 Means GL11, and 1.0 Means GL10.
1

You can use instanceof on your GL10 instance to test if GL11 or higher is supported:

public void onSurfaceCreated(GL10 gl, EGLConfig config) { if(gl instanceof GL11) { // ... } } 

Comments

0

Use glGetString to query the version info, You have to be careful when parsing the returned string - some implementations don't quite follow the spec - but the code here works for me.

Comments

0

In practice, anything that actually has graphics hardware, will support 1.1. 1.0 was a profile designed for software implementations, and there exists no hardware that supports only 1.0 afaik.

If it doesn't have graphics hardware, you don't really want to run your gl app on it anyhow because of very poor performance, so you could just as well set AndroidManifest.xml to specify version 0x00010001, and then you know it will support GL11.

Also, anything released in '11 or later will most probably support GLES 2.0 (and all gl2.0 support gl1.1)

Check the android market stats, 90.5% of devices support 2.0, and 1.0 isn't even in the stats, because 1.0 is never used by anyone.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.