其他分享
首页 > 其他分享> > android – 如果不支持EGL_NATIVE_RENDERABLE,如何通过C / NDK访问OpenGL ES 2?

android – 如果不支持EGL_NATIVE_RENDERABLE,如何通过C / NDK访问OpenGL ES 2?

作者:互联网

我的应用程序(用C语言编写,带有Java引导代码)在我的Android MID设备上运行完美,但它不适用于朋友的Moto MB865手机.
在使用GL上下文创建过程进行挖掘之后,我发现对于支持OpenGL ES 2.0的所有配置,EGL_NATIVE_RENDERABLE都是GL_FALSE

这意味着我无法使用我的本机代码访问OpenGL ES 2.0.

为什么系统有这个奇怪的限制?我认为本机代码可以在此之前访问所有OpenGL配置.

有没有办法解决这个限制?或者我是否必须编写代理才能通过JNI访问EGL2?

解决方法:

EGL_NATIVE_RENDERABLE与NDK无关.

它只表示本机渲染API绘制缓冲区的能力.

请参阅EGL规范:http://www.khronos.org/registry/egl/specs/eglspec.1.4.pdf
第2.2.3段与本机渲染的互动:

Native rendering will always be supported by pixmap surfaces (to the
extent that native rendering APIs can draw to native pixmaps). Pixmap
surfaces are typically used when mixing native and client API
rendering is desirable, since there is no need to move data between
the back buffer visible to the client APIs and the native pixmap
visible to native rendering APIs. However, pixmap surfaces may, for
the same reason, have restricted capabilities and performance relative
to window and pbuffer surfaces. Native rendering will not be supported
by pbuffer surfaces, since the color buffers of pbuffers are allocated
internally by EGL and are not accessible through any other means.

您的问题的原因应该是不同的(GLES 2.0不受支持,等等).

标签:c-2,android,android-ndk,opengl-es,opengl-es-2-0
来源: https://codeday.me/bug/20190704/1375572.html