mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-27 16:28:40 +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:
parent
764b899a13
commit
8121bbd083
96 changed files with 938 additions and 1243 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue