summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorubkp <[email protected]>2023-12-28 16:08:04 -0300
committerGitHub <[email protected]>2023-12-28 20:08:04 +0100
commit43b4f90eb7b12bff4539a419663ebbfbf4f58503 (patch)
treed61dea52cef79b0adf3e4e10e83a28c3aab77de8 /src
parent1727ddb9ea3de9fb4f5f4e287958ac85c77a5213 (diff)
downloadraylib-43b4f90eb7b12bff4539a419663ebbfbf4f58503.tar.gz
raylib-43b4f90eb7b12bff4539a419663ebbfbf4f58503.zip
Fix SUPPORT_WINMM_HIGHRES_TIMER for PLATFORM_DESKTOP_SDL (#3679)
Diffstat (limited to 'src')
-rw-r--r--src/platforms/rcore_desktop_sdl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c
index 1e55cbac..28dd9d1d 100644
--- a/src/platforms/rcore_desktop_sdl.c
+++ b/src/platforms/rcore_desktop_sdl.c
@@ -1112,7 +1112,7 @@ void PollInputEvents(void)
case SDL_TEXTINPUT:
{
// NOTE: event.text.text data comes an UTF-8 text sequence but we register codepoints (int)
-
+
int codepointSize = 0;
// Check if there is space available in the key queue
@@ -1426,6 +1426,10 @@ int InitPlatform(void)
//----------------------------------------------------------------------------
// NOTE: No need to call InitTimer(), let SDL manage it internally
CORE.Time.previous = GetTime(); // Get time as double
+
+ #if defined(_WIN32) && defined(SUPPORT_WINMM_HIGHRES_TIMER) && !defined(SUPPORT_BUSY_WAIT_LOOP)
+ SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "1"); // SDL equivalent of timeBeginPeriod() and timeEndPeriod()
+ #endif
//----------------------------------------------------------------------------
// Initialize storage system