From 0de2e8092bf0685e777cf0a97c4f4c059a896173 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 17 Mar 2026 19:38:29 +0100 Subject: [PATCH] REVIEWED: `GetTime()`, make sure division is with doubles #5668 --- src/platforms/rcore_desktop_sdl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 0cf18a15d..2bf846be0 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -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()