mirror of
https://github.com/raysan5/raylib.git
synced 2026-03-19 15:18:11 +00:00
REVIEWED: GetTime(), make sure division is with doubles #5668
This commit is contained in:
@@ -1276,7 +1276,7 @@ void SwapScreenBuffer(void)
|
||||
// Get elapsed time measure in seconds
|
||||
double GetTime(void)
|
||||
{
|
||||
double time = (double)(SDL_GetPerformanceCounter()/SDL_GetPerformanceFrequency()) - CORE.Time.base;
|
||||
double time = ((double)SDL_GetPerformanceCounter()/(double)SDL_GetPerformanceFrequency()) - CORE.Time.base;
|
||||
|
||||
return time;
|
||||
}
|
||||
@@ -2125,7 +2125,7 @@ int InitPlatform(void)
|
||||
// Initialize timing system
|
||||
//----------------------------------------------------------------------------
|
||||
// Get base time from window initialization
|
||||
CORE.Time.base = (double)(SDL_GetPerformanceCounter()/SDL_GetPerformanceFrequency());
|
||||
CORE.Time.base = (double)SDL_GetPerformanceCounter()/(double)SDL_GetPerformanceFrequency();
|
||||
|
||||
#if defined(_WIN32) && SUPPORT_WINMM_HIGHRES_TIMER && !SUPPORT_BUSY_WAIT_LOOP
|
||||
SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "1"); // SDL equivalent of timeBeginPeriod() and timeEndPeriod()
|
||||
|
||||
Reference in New Issue
Block a user