浏览代码

rcore_platform_sdl: Fix `GetTime()` resolution for sdl

`SDL_GetTicks()` only has millisecond resolution so switched to
`SLD_GetPerformanceCounter()` combined with
`SDL_GetPerformanceFrequency()` which should allow more granular timing
pull/5653/head
Soma Mizobuchi 1 天前
父节点
当前提交
ce5cebe999
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. +1
    -2
      src/platforms/rcore_desktop_sdl.c

+ 1
- 2
src/platforms/rcore_desktop_sdl.c 查看文件

@ -1276,8 +1276,7 @@ void SwapScreenBuffer(void)
// Get elapsed time measure in seconds
double GetTime(void)
{
unsigned int ms = SDL_GetTicks(); // Elapsed time in milliseconds since SDL_Init()
double time = (double)ms/1000;
double time = (double)SDL_GetPerformanceCounter() / (double)SDL_GetPerformanceFrequency();
return time;
}

正在加载...
取消
保存