mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-28 02:04:20 +00:00
Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512 Fixes https://github.com/libsdl-org/SDL/issues/6731
This commit is contained in:
@@ -22,45 +22,20 @@
|
||||
|
||||
#if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED)
|
||||
|
||||
static SDL_bool ticks_started = SDL_FALSE;
|
||||
|
||||
void SDL_TicksInit(void)
|
||||
{
|
||||
if (ticks_started) {
|
||||
return;
|
||||
}
|
||||
ticks_started = SDL_TRUE;
|
||||
}
|
||||
|
||||
void SDL_TicksQuit(void)
|
||||
{
|
||||
ticks_started = SDL_FALSE;
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_GetTicks64(void)
|
||||
SDL_GetPerformanceCounter(void)
|
||||
{
|
||||
if (!ticks_started) {
|
||||
SDL_TicksInit();
|
||||
}
|
||||
|
||||
SDL_Unsupported();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_GetPerformanceCounter(void)
|
||||
{
|
||||
return SDL_GetTicks();
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_GetPerformanceFrequency(void)
|
||||
{
|
||||
return 1000;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SDL_Delay(Uint32 ms)
|
||||
void SDL_DelayNS(Uint64 ns)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user