Is there a way to check if Android device supports openGL ES 2.0?

后端 未结 7 1039
轻奢々
轻奢々 2020-12-02 23:16

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

7条回答
  •  鱼传尺愫
    2020-12-02 23:55

    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;
    

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

    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:

    
    

    See also the doc of uses-feature.

提交回复
热议问题