102f4aeb0Sopenharmony_ciName
202f4aeb0Sopenharmony_ci
302f4aeb0Sopenharmony_ci    NV_system_time
402f4aeb0Sopenharmony_ci
502f4aeb0Sopenharmony_ciName Strings
602f4aeb0Sopenharmony_ci
702f4aeb0Sopenharmony_ci    EGL_NV_system_time
802f4aeb0Sopenharmony_ci
902f4aeb0Sopenharmony_ciContact
1002f4aeb0Sopenharmony_ci
1102f4aeb0Sopenharmony_ci    Jason Allen, NVIDIA Corporation (jallen 'at' nvidia.com)
1202f4aeb0Sopenharmony_ci
1302f4aeb0Sopenharmony_ciStatus
1402f4aeb0Sopenharmony_ci
1502f4aeb0Sopenharmony_ci    TBD
1602f4aeb0Sopenharmony_ci
1702f4aeb0Sopenharmony_ciVersion
1802f4aeb0Sopenharmony_ci
1902f4aeb0Sopenharmony_ci    Version 1, July 7, 2011
2002f4aeb0Sopenharmony_ci
2102f4aeb0Sopenharmony_ciNumber
2202f4aeb0Sopenharmony_ci
2302f4aeb0Sopenharmony_ci    EGL Extension #31
2402f4aeb0Sopenharmony_ci
2502f4aeb0Sopenharmony_ciDependencies
2602f4aeb0Sopenharmony_ci
2702f4aeb0Sopenharmony_ci    Requires EGL 1.2
2802f4aeb0Sopenharmony_ci
2902f4aeb0Sopenharmony_ciOverview
3002f4aeb0Sopenharmony_ci
3102f4aeb0Sopenharmony_ci    This extension exposes an alternative method of querying the system time
3202f4aeb0Sopenharmony_ci    from the driver instead of the operating system. 
3302f4aeb0Sopenharmony_ci
3402f4aeb0Sopenharmony_ciIssues
3502f4aeb0Sopenharmony_ci
3602f4aeb0Sopenharmony_ci    Add 64 bit types?
3702f4aeb0Sopenharmony_ci
3802f4aeb0Sopenharmony_ci      Yes, EGL doesn't support any 64 bit types so this extension adds int64
3902f4aeb0Sopenharmony_ci      and uint64 types.
4002f4aeb0Sopenharmony_ci
4102f4aeb0Sopenharmony_ciNew Types
4202f4aeb0Sopenharmony_ci
4302f4aeb0Sopenharmony_ci    EGLint64NV: 64bit signed integer
4402f4aeb0Sopenharmony_ci    EGLuint64NV: 64bit unsigned integer
4502f4aeb0Sopenharmony_ci
4602f4aeb0Sopenharmony_ciNew Procedures and Functions
4702f4aeb0Sopenharmony_ci
4802f4aeb0Sopenharmony_ci    EGLuint64NV eglGetSystemTimeFrequencyNV(void);
4902f4aeb0Sopenharmony_ci    EGLuint64NV eglGetSystemTimeNV(void);
5002f4aeb0Sopenharmony_ci
5102f4aeb0Sopenharmony_ciNew Tokens
5202f4aeb0Sopenharmony_ci
5302f4aeb0Sopenharmony_ci    None
5402f4aeb0Sopenharmony_ci
5502f4aeb0Sopenharmony_ciDescription
5602f4aeb0Sopenharmony_ci
5702f4aeb0Sopenharmony_ci    The command:
5802f4aeb0Sopenharmony_ci
5902f4aeb0Sopenharmony_ci        EGLuint64NV eglGetSystemTimeFrequencyNV(void);
6002f4aeb0Sopenharmony_ci
6102f4aeb0Sopenharmony_ci    returns the frequency of the system timer, in counts per second. The
6202f4aeb0Sopenharmony_ci    frequency will not change while the system is running.
6302f4aeb0Sopenharmony_ci
6402f4aeb0Sopenharmony_ci    The command:
6502f4aeb0Sopenharmony_ci
6602f4aeb0Sopenharmony_ci        EGLuint64NV eglGetSystemTimeNV(void);
6702f4aeb0Sopenharmony_ci
6802f4aeb0Sopenharmony_ci    returns the current value of the system timer. The system time in seconds
6902f4aeb0Sopenharmony_ci    can be calculated by dividing the returned value by the frequency returned
7002f4aeb0Sopenharmony_ci    by the eglGetSystemTimeFrequencyNV command.
7102f4aeb0Sopenharmony_ci
7202f4aeb0Sopenharmony_ci    Multiple calls to eglGetSystemTimeNV may return the same values, applications
7302f4aeb0Sopenharmony_ci    need to be careful to avoid divide by zero errors when using the interval
7402f4aeb0Sopenharmony_ci    calculated from successive eglGetSystemTimeNV calls.
7502f4aeb0Sopenharmony_ci
7602f4aeb0Sopenharmony_ciUsage Example
7702f4aeb0Sopenharmony_ci
7802f4aeb0Sopenharmony_ci    EGLuint64NV frequency = eglGetSystemTimeFrequencyNV();
7902f4aeb0Sopenharmony_ci
8002f4aeb0Sopenharmony_ci    loop
8102f4aeb0Sopenharmony_ci    {
8202f4aeb0Sopenharmony_ci        EGLuint64NV start = eglGetSystemTimeNV() / frequency;
8302f4aeb0Sopenharmony_ci
8402f4aeb0Sopenharmony_ci        // draw 
8502f4aeb0Sopenharmony_ci
8602f4aeb0Sopenharmony_ci        EGLuint64NV end = eglGetSystemTimeNV() / frequency;
8702f4aeb0Sopenharmony_ci
8802f4aeb0Sopenharmony_ci        EGLuint64NV interval = end - start;
8902f4aeb0Sopenharmony_ci        if (interval > 0)
9002f4aeb0Sopenharmony_ci            update_animation(interval);
9102f4aeb0Sopenharmony_ci
9202f4aeb0Sopenharmony_ci        eglSwapBuffers(dpy, surface);
9302f4aeb0Sopenharmony_ci    }
9402f4aeb0Sopenharmony_ci
9502f4aeb0Sopenharmony_ciRevision History
9602f4aeb0Sopenharmony_ci
9702f4aeb0Sopenharmony_ci#1 (Jon Leech, 2011/07/07)
9802f4aeb0Sopenharmony_ci  - Add missing fields, assign extension number, and publish in the registry.
9902f4aeb0Sopenharmony_ci
100