1Name 2 3 NV_system_time 4 5Name Strings 6 7 EGL_NV_system_time 8 9Contact 10 11 Jason Allen, NVIDIA Corporation (jallen 'at' nvidia.com) 12 13Status 14 15 TBD 16 17Version 18 19 Version 1, July 7, 2011 20 21Number 22 23 EGL Extension #31 24 25Dependencies 26 27 Requires EGL 1.2 28 29Overview 30 31 This extension exposes an alternative method of querying the system time 32 from the driver instead of the operating system. 33 34Issues 35 36 Add 64 bit types? 37 38 Yes, EGL doesn't support any 64 bit types so this extension adds int64 39 and uint64 types. 40 41New Types 42 43 EGLint64NV: 64bit signed integer 44 EGLuint64NV: 64bit unsigned integer 45 46New Procedures and Functions 47 48 EGLuint64NV eglGetSystemTimeFrequencyNV(void); 49 EGLuint64NV eglGetSystemTimeNV(void); 50 51New Tokens 52 53 None 54 55Description 56 57 The command: 58 59 EGLuint64NV eglGetSystemTimeFrequencyNV(void); 60 61 returns the frequency of the system timer, in counts per second. The 62 frequency will not change while the system is running. 63 64 The command: 65 66 EGLuint64NV eglGetSystemTimeNV(void); 67 68 returns the current value of the system timer. The system time in seconds 69 can be calculated by dividing the returned value by the frequency returned 70 by the eglGetSystemTimeFrequencyNV command. 71 72 Multiple calls to eglGetSystemTimeNV may return the same values, applications 73 need to be careful to avoid divide by zero errors when using the interval 74 calculated from successive eglGetSystemTimeNV calls. 75 76Usage Example 77 78 EGLuint64NV frequency = eglGetSystemTimeFrequencyNV(); 79 80 loop 81 { 82 EGLuint64NV start = eglGetSystemTimeNV() / frequency; 83 84 // draw 85 86 EGLuint64NV end = eglGetSystemTimeNV() / frequency; 87 88 EGLuint64NV interval = end - start; 89 if (interval > 0) 90 update_animation(interval); 91 92 eglSwapBuffers(dpy, surface); 93 } 94 95Revision History 96 97#1 (Jon Leech, 2011/07/07) 98 - Add missing fields, assign extension number, and publish in the registry. 99 100