Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 521
Erik Sapir Avatar asked Feb 08 '12 17:02

Erik Sapir


People also ask

Does Android use OpenGL ES?

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 do I know my OpenGL mobile version?

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).

Can I update OpenGL version Android?

You can't. The OpenGL version supported depends on the hardware capabilities of your GPU.

Is OpenGL and OpenGL ES the same?

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).


1 Answers

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.

like image 69
Foggzie Avatar answered Oct 11 '22 14:10

Foggzie