Created
February 25, 2014 03:57
-
-
Save chrisledet/9202408 to your computer and use it in GitHub Desktop.
Utility class for checking supported OpenGL versions on Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- require want to restrict devices that don't support 2.0 from seeing your app in the marketplace by adding the following --> | |
| <uses-feature android:glEsVersion="0x00020000" android:required="true" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.ActivityManager; | |
| import android.content.Context; | |
| import android.content.pm.ConfigurationInfo; | |
| public class OpenGLVersionChecker { | |
| final Context context; | |
| final ConfigurationInfo configurationInfo; | |
| public OpenGLVersionChecker(Context context) { | |
| this.context = context; | |
| ActivityManager activityManager = (ActivityManager) this.context.getSystemService(Context.ACTIVITY_SERVICE); | |
| this.configurationInfo = activityManager.getDeviceConfigurationInfo(); | |
| } | |
| public boolean isES2Supported() { | |
| return configurationInfo.reqGlEsVersion >= 0x20000; | |
| } | |
| public boolean isES1Supported() { | |
| return configurationInfo.reqGlEsVersion >= 0x10000; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment