How to access OpenGL ES 2 through C ++ / NDK if EGL_NATIVE_RENDERABLE is not supported?

My application (written in C ++ with Java bootstrap code) works fine on my Android MID device, but it doesn't work on another Moto MB865 phone. After digging through the GL context creation routine, I found that EGL_NATIVE_RENDERABLE is GL_FALSE for all configurations that support OpenGL ES 2.0

This means that I cannot access OpenGL ES 2.0 with my own code.

Why does the system have this strange limitation? I thought that native code could access all OpenGL configurations before that.

Is there a way around this limitation? Or do I need to write a delegate to access EGL2 through JNI?

+4
source share
1 answer

EGL_NATIVE_RENDERABLE has nothing to do with NDK.

It simply indicates the ability of the native rendering API to draw on buffers.

Refer to the EGL specification: http://www.khronos.org/registry/egl/specs/eglspec.1.4.pdf Clause 2.2.3 Interaction With Native Rendering :

Native rendering will always be supported by pixel surfaces (to which native rendering APIs can draw on native pixmaps). Pixmap surfaces are generally used when mixing native and client APIs. Rendering is desirable since there is no need to move data between the reverse buffer visible for client APIs and the native pixmap visible for built-in processing APIs. However, pixmap surfaces may, for the same reason, have limited capabilities for both the surface of the window and the pbuffer. Native rendering is not supported using pbuffer surfaces, since pbuffer color buffers are allocated internally using EGL and are not available in any other way.

The cause of your problem should be different (GLES 2.0 is not supported, etc.).

+2
source

All Articles