I need to check dynamically if the used device supports openGL ES 2.0. How can i do that?
Android includes support for high performance 2D and 3D graphics with the Open Graphics Library (OpenGL®), specifically, the OpenGL ES API. OpenGL is a cross-platform graphics API that specifies a standard software interface for 3D graphics processing hardware.
How can I check the OpenGL version of my Android device? You can search the internet for information about the capabilities of the contained graphics adapter (search term: ModelOfYourDevice OpenGL).
You can't. The OpenGL version supported depends on the hardware capabilities of your GPU.
The main difference between the two is that OpenGL ES is made for embedded systems like smartphones, while OpenGL is the one on desktops. On the coding level, OpenGL ES does not support fixed-function functions like glBegin/glEnd etc... OpenGL can support fixed-function pipeline (using a compatibility profile).
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:
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
See also the doc of uses-feature
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With