我正在使用此代码在手机上获取 OpenGL ES 版本。
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 support openGL ES 2.0?
在我的 Nexus 5 上,我将 GLES 版本设为 3.0。但是根据这个文档http://developer.android.com/guide/topics/graphics/opengl.html,我应该得到 3.1 因为“OpenGL ES 3.1 - Android 5.0 (API level 21) 支持这个 API 规范和更高。”
我想我应该得到 3.1 作为 OpenGL ES 版本。谁能告诉我为什么我得到 3.0 作为 OpenGL ES 版本?