Appendix A: EGL Extensions


EGL_NV_system_time

Name
egl_nv_system_time
Name Strings
EGL_NV_system_time
Contact NVIDIA Corporation (NVPerfHUDESDev@nvidia.com
Dependencies Requires EGL 1.2.
Overview This extension exposes an alternative method of querying the system time from the driver instead of the operating system.
Issues Add 64 bit types?
Yes, EGL doesn't support any 64 bit types, so this extension adds int64 and uint64 types.
New Types
typedef long long int EGLint64NV;
typedef unsigned long long int EGLEGLuint64NV;
New Procedures
and Functions
EGLuint64NV eglGetSystemTimeFrequencyNV(void);
EGLuint64NV eglGetSystemTimeNV(void);
New Tokens None.
Description

The command:

EGLuint64NV eglGetSystemTimeFrequencyNV(void);

Returns the frequency of the system timer, in counts per second. The frequency will not change while the system is running.

The command:

EGLuint64NV eglGetSystemTimeNV(void);

Returns the current value of the system timer. The system time in seconds can be calculated by dividing the returned value by the frequency returned by the GetSystemTimeFrequencyNV command. Multiple calls to GetSystemTimeNV may return the same values, applications need to be careful to avoid divide by zero errors when using the interval calculated from successive GetSystemTimeNV calls.

Usage Example
EGLuint64NV frequency = eglGetSystemTimeFrequencyNV();
loop
{
      EGLuint64NV start = eglGetSystemTimeNV() / frequency; 
      // draw 
      EGLuint64NV end = eglGetSystemTimeNV() / frequency; 
      EGLuint64NV interval = end - start; 
      if (interval > 0) update_animation(interval); 
      eglSwapBuffers(dpy, surface);
}  


NVIDIA® GameWorks™ Documentation Rev. 1.0.200601 ©2014-2020. NVIDIA Corporation. All Rights Reserved.