4

我想在我的(从 GLSurfaceView 扩展)中使用eglPresentationTimeANDROID 。ExtendedGLSurfaceView

该方法出现在:

EGLExt.eglPresentationTimeANDROID(android.opengl.EGLDisplay display, android.opengl.EGLSurface surface, long time);

我的主要问题是GLSurfaceView使用EGLDisplay,EGLContextEGLSurfacefrom javax.microedition.khronos.egl。但是,eglPresentationTimeANDROID需要EGLDisplayEGLSurfaceandroid.opengl.EGLDisplay

有什么快速解决办法吗?还是我需要重做所有ExtendedGLSurfaceView要使用的android.opengl课程?

4

1 回答 1

1

我不认为这很重要。IIRC,这一切都变成了引擎盖下的同一件事。EGL10 和 EGL14 类只是底层本机代码的不同接口。

不过,我不能保证永远都是这种情况,因此将代码更新到较新版本会更安全。EGL14 自 API 17 (Android 4.2) 以来一直存在,我认为最近的 Android 正在使用 EGL 1.5。 此代码在 EGL 1.0 和 1.4 中实现了两次,因此它可以用作移植示例。

FWIW,您可能会发现这个答案很有趣。

于 2016-10-11T03:08:43.770 回答