Skip to content

Commit e6a34d4

Browse files
authored
ogc: Fix timer precision (#89)
SDL_GetPerformanceCounter is supposed to return the value of a high precision counter, but SDL_GetTicks64 returns a truncated value in milliseconds. Correctly return gettime() as a high precision counter instead, and update SDL_GetPerformanceFrequency accordingly.
1 parent 7f07fe1 commit e6a34d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/timer/ogc/SDL_systimer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ Uint64 SDL_GetTicks64(void)
5353

5454
Uint64 SDL_GetPerformanceCounter(void)
5555
{
56-
return SDL_GetTicks64();
56+
return gettime();
5757
}
5858

5959
Uint64 SDL_GetPerformanceFrequency(void)
6060
{
61-
return 1000;
61+
return secs_to_ticks(1);
6262
}
6363

6464
void SDL_Delay(Uint32 ms)

0 commit comments

Comments
 (0)