From f20b413e7d79d4c5497580f8266b3fa392dfba32 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Wed, 9 Oct 2024 21:21:33 -0300 Subject: [PATCH] SDL3: Remove usage of SDL_DelayNS in sleep calls. SDL3 currently busy-waits in its implementation, which defeats the purpose of the sleep calls. --- src/common/delay.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/delay.cpp b/src/common/delay.cpp index 13db3958c..c853743f9 100644 --- a/src/common/delay.cpp +++ b/src/common/delay.cpp @@ -31,16 +31,12 @@ namespace love { -// TODO: use ns. +// TODO: use ns. https://github.com/libsdl-org/SDL/issues/11141 void sleep(double ms) { // We don't need to initialize the SDL timer subsystem for SDL_Delay to // function - and doing so causes SDL to create a worker thread. -#if SDL_VERSION_ATLEAST(3, 0, 0) - SDL_DelayNS(SDL_MS_TO_NS(ms)); -#else SDL_Delay((Uint32)ms); -#endif } } // love