One big issue with versions 2.2 and below of Android is that you cannot query extension’s methods from OpenGL ES.
But there’s a simple hack I tested in my LG Optimus 2x:
- in /system/lib/egl directory, there’s a library called libEGL_tegra.so. Open it with dlopen method in NDK:
void* eglLibrary = dlopen(“libEGL_tegra.so”);
- query for method eglGetProcAddress with dlsym method. Hopefully, you’ll obtain a valid address:
typedef void* (*PFNEGLGETPROCADDRESS)(const char* procName);
PFNEGLGETPROCADDRESS getProcAddress = (PFNEGLGETPROCADDRESS) dlsym(eglLibrary, “eglGetProcAddress”);
- Now, query OGLES extension methods normally:
typedef void (*PFNGLCOVERAGEMASKNV)(GLboolean mask);
PFNGLCOVERAGEMASKNV glCoverageMaskNV = (PFNGLCOVERAGEMASKNV) getProcAddress(“glCoverageMaskNV”);
- Don’t forget to close the library at the end of the program:
Other devices must be similar libraries in the same directory. I’ll post some updates about this.