Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android OpenGL ES --- All Extensions Supported?

I'm really confused about how OpenGL ES extensions work on Android, both in the Java API, and also in the NDK's API.

Firstly, I'm coming from the world of vanilla OpenGL on the desktop. In that world, extensions are pretty intuitive to load and use. First you check the GL_EXTENSIONS to see if the system advertises the extensions you need, and then you dynamically load the extension's entry points via wglGetProcAddress, glXGetProcAddress, or dlsym (depending on if you're on WinAPI, X11, or OS X, respectively).

But now, today I just had my first look at the GL11Ext interface on android, located here: http://developer.android.com/reference/javax/microedition/khronos/opengles/GL11Ext.html

My first thought was "Wah, what!? So ALL extensions are loaded by deafult!?" So, what happens if you try to use an extension that's not advertised by the system?

Now, what I find even more baffling is OpenGL ES extensions via the NDK, which seem totally useless to me (unless someone can explain to me how to load them). I need to target android 2.2, so I'm using the android-8 NDK platform headers. When I look at android-8's headers, I do find GLES/glext.h and GLES2/gl2ext.h, BUT NOWHERE IS eglGetProcAddress() TO BE FOUND!

I suppose that glext.h and gl2ext.h do expose function declarations for extensions, but if you're going to tell me that I should use them then I'm still going to be just as confused. Because in that case we're back to the question I had about the Java APIs, which is "So all extensions are loaded by default in the NDK's ES API as well?"

like image 780
fieldtensor Avatar asked Aug 07 '11 04:08

fieldtensor


People also ask

Does OpenGL support Android?

OpenGL ES 2.0 Supported by: The Android platform since Android 2.0 through NDK and Android 2.2 through Java.

What is OpenGL ES version?

OpenGL ES is the dominant graphics API in today's smartphones and has even extended its reach onto the desktop. The list of platforms supporting OpenGL ES includes iOS, Android, BlackBerry, bada, Linux, and Windows. OpenGL ES also underpins WebGL, a web standard for browser-based 3D graphics.

How do I find my OpenGL version Android?

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


1 Answers

The only extensions made available in the Java APIs are extensions required to be present on all Android devices. That's why you won't find vendor specific extensions in the Java API for instance. The latest NDK provides eglGetProcAddress in the android-9 headers.

like image 178
Romain Guy Avatar answered Oct 05 '22 23:10

Romain Guy