0

I am using this code to get OpenGL ES version on my phone.

int result;
    ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    ConfigurationInfo configInfo = activityManager
            .getDeviceConfigurationInfo();
    if (configInfo.reqGlEsVersion != ConfigurationInfo.GL_ES_VERSION_UNDEFINED) {
        result = configInfo.reqGlEsVersion;
    } else {
        result = 1 << 16; // Lack of property means OpenGL ES version 1
    }

    Log.e("reqGlEsVersion", String.valueOf(result));
    Log.e("getGlEsVersion", configInfo.getGlEsVersion());

I have found this code from this link: Is there a way to check if Android device supports openGL ES 2.0?

On my Nexus 5, I am getting GLES version as 3.0. But according to this doc, http://developer.android.com/guide/topics/graphics/opengl.html, I should get 3.1 because "OpenGL ES 3.1 - This API specification is supported by Android 5.0 (API level 21) and higher."

I think I should get 3.1 as OpenGL ES version. Can anyone tell me why I am getting 3.0 as OpenGL ES version ?

Community
  • 1
  • 1
Bunny
  • 576
  • 4
  • 19

1 Answers1

1

While API 21 supports GLES 3.1, it doesn't guarantee its availability. This is the reason for checking the version of GLES being used at runtime (as explained in the android docs you linked), otherwise you would just need to require it in your manifest.

If you have a Nexus 5, it has an Adreno 330, which only supports GLES 3.0. So, if you want your application to run on your Nexus 5, you're stuck with GLES 3.0, otherwise, you should get a device that supports GLES 3.1, and require it in your manifest.

MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78