Re: Missing eglGetSystemTimeNV on libEGL.so

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Missing eglGetSystemTimeNV on libEGL.so

Ken Turkowski
I guess that, with the NV suffix, that this function is only available on NVidia GPUs.

On Nov 2, 2012, at 6:41 PM, 0Camus0 wrote:

> Hi,
>
> I'm trying to use eglGetSystemTimeNV function, it's defined on the eglext.h under EGL_EGLEXT_PROTOTYPES.
>
> If I define EGL_EGLEXT_PROTOTYPES, it compiles but I get undefined reference to eglGetSystemTimeNV, -lEGL.so is linked, I can call other egl functions. After checking the .so there is NO reference at all, not in the platform 9 nor in the 14.
>
> There is almost no info about this.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Reply | Threaded
Open this post in threaded view
|

Re: Missing eglGetSystemTimeNV on libEGL.so

Jamie Gennis
That's correct.  The EGL_NV_system_time extension is not guaranteed to be present on all devices. The proper way to use an extension like this is to first query that the extension is present on the device your app is running on via eglQueryString(dpy, EGL_EXTENSIONS) and some string parsing.  If it is present, then you can query the function pointer by calling eglGetProcAddress("eglGetSystemTimeNV") and casting the result to the function typedef that's defined in eglext.h.  For example:

PFNEGLGETSYSTEMTIMENVPROC eglGetSystemTimeNV;
eglGetSystemTimeNV = (PFNEGLGETSYSTEMTIMENVPROC) eglGetProcAddress("eglGetSystemTimeNV");

In general, you shouldn't need to define EGL_EGLEXT_PROTOTYPES, which is why it's not defined by default.

I would also suggest that you try using the more portable clock_gettime call (probably with CLOCK_MONOTONIC) rather than using EGL to get the time.  You can call that directly without any of this extension querying stuff.

On Tuesday, January 8, 2013 12:14:06 PM UTC-8, Turk wrote:
I guess that, with the NV suffix, that this function is only available on NVidia GPUs.

On Nov 2, 2012, at 6:41 PM, 0Camus0 wrote:

> Hi,
>
> I'm trying to use eglGetSystemTimeNV function, it's defined on the eglext.h under EGL_EGLEXT_PROTOTYPES.
>
> If I define EGL_EGLEXT_PROTOTYPES, it compiles but I get undefined reference to eglGetSystemTimeNV, -lEGL.so is linked, I can call other egl functions. After checking the .so there is NO reference at all, not in the platform 9 nor in the 14.
>
> There is almost no info about this.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/DDIfnvTZepQJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Missing eglGetSystemTimeNV on libEGL.so

David Turner
In reply to this post by Ken Turkowski
It's an extension, that's why there are no reference to it in the platform libraries themselves (since it's completely optional and not available on all devices). You need to use eglGetProcAddress() to retrieve the address of the function (which will be NULL if the extension is not supported).

IIRC, EGL_EGLEXT_PROTOTYPES is only useful is you know in advance that the functions your use are exported by the system EGL library, or if you implement your own wrapper with the same name. This is certainly not the case here.

On Tue, Jan 8, 2013 at 9:14 PM, Ken Turkowski <[hidden email]> wrote:
I guess that, with the NV suffix, that this function is only available on NVidia GPUs.

On Nov 2, 2012, at 6:41 PM, 0Camus0 wrote:

> Hi,
>
> I'm trying to use eglGetSystemTimeNV function, it's defined on the eglext.h under EGL_EGLEXT_PROTOTYPES.
>
> If I define EGL_EGLEXT_PROTOTYPES, it compiles but I get undefined reference to eglGetSystemTimeNV, -lEGL.so is linked, I can call other egl functions. After checking the .so there is NO reference at all, not in the platform 9 nor in the 14.
>
> There is almost no info about this.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.