androidglsurfaceviewgrafika

eglPresentationTimeANDROID(): Can I use microedition.khronos instead of android.opengl?


I want to use eglPresentationTimeANDROID in my ExtendedGLSurfaceView (extended from GLSurfaceView).

The method appears in:

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

My main issue is that GLSurfaceView uses EGLDisplay, EGLContext and EGLSurface from javax.microedition.khronos.egl. However, eglPresentationTimeANDROID takes EGLDisplay and EGLSurface from android.opengl.EGLDisplay

Is there is any quick fix? Or do I need to redo all my ExtendedGLSurfaceView to use android.opengl classes?


Solution

  • I don't think it matters. IIRC, it all turns into the same thing under the hood. The EGL10 and EGL14 classes are just different interfaces to the underlying native code.

    I can't guarantee that this will always be the case, though, so it's safer to update your code to the newer version. EGL14 has been around since API 17 (Android 4.2), and I think recent Android is using EGL 1.5. This code was implemented twice, with EGL 1.0 and 1.4, so it can serve as a porting example.

    FWIW, you may find this answer of interest.