有没有办法检查 Android 设备是否支持 openGL ES 2.0? [英] Is there a way to check if Android device supports openGL ES 2.0?

查看:25
本文介绍了有没有办法检查 Android 设备是否支持 openGL ES 2.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动态检查使用的设备是否支持 openGL ES 2.0.我该怎么做?

I need to check dynamically if the used device supports openGL ES 2.0. How can i do that?

推荐答案

是的.以下代码可以解决问题:

Yes. The following code will do the trick:

final ActivityManager activityManager = 
    (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = 
    activityManager.getDeviceConfigurationInfo();
final boolean supportsEs2 = configurationInfo.reqGlEsVersion >= 0x20000;

阅读本文了解更多信息:http://www.learnopengles.com/android-lesson-one-getting-开始/

Read this for more info: http://www.learnopengles.com/android-lesson-one-getting-started/

您可能还需要通过将以下内容添加到清单中来限制不支持 2.0 的设备在市场上看到您的应用:

You may also require want to restrict devices that don't support 2.0 from seeing your app in the marketplace by adding the following to your manifest:

<uses-feature android:glEsVersion="0x00020000" android:required="true" />

另请参阅 uses 的文档-特征.

这篇关于有没有办法检查 Android 设备是否支持 openGL ES 2.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆