我正在使用此代码在手机上获取OpenGL ES版本。getGlEsVersion()在我的nexus 5上使用android版本6.0.1返回3.0
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());
我发现从这个链接验证码:Is there a way to check if Android device supports openGL ES 2.0?
在我的Nexus 5,我越来越GLES版本为3.0。但根据这个文档,http://developer.android.com/guide/topics/graphics/opengl.html,我应该得到3.1,因为“OpenGL ES 3.1 - 这个API规范是由Android 5.0(API级别21)和更高的支持。”
我想我应该得到3.1作为OpenGL ES版本。任何人都可以告诉我为什么我获得3.0作为OpenGL ES版本?