From 22c81e5292b8a1b9b209346cb30bec5547845ac4 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 23 Feb 2025 17:08:43 +0100 Subject: [PATCH] Print if sdl2-compat is in use --- irr/src/CIrrDeviceSDL.cpp | 32 ++++++++++++++++++-------------- irr/src/CIrrDeviceSDL.h | 1 - 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index 2775858f3..f0f0db577 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -308,8 +308,6 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters ¶m) : if (SDL_Init(flags) < 0) { os::Printer::log("Unable to initialize SDL", SDL_GetError(), ELL_ERROR); Close = true; - } else { - os::Printer::log("SDL initialized", ELL_INFORMATION); } } @@ -324,21 +322,27 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters ¶m) : } } - SDL_VERSION(&Info.version); + core::stringc sdlver = "SDL "; + { + SDL_version v{}; + SDL_GetVersion(&v); + sdlver += v.major; + sdlver += "."; + sdlver += v.minor; + sdlver += "."; + sdlver += v.patch; + // the SDL team seems to intentionally number sdl2-compat this way: + // + if (v.patch >= 50) + sdlver += " (compat)"; -#ifndef _IRR_EMSCRIPTEN_PLATFORM_ - SDL_GetWindowWMInfo(Window, &Info); -#endif //_IRR_EMSCRIPTEN_PLATFORM_ - core::stringc sdlversion = "SDL Version "; - sdlversion += Info.version.major; - sdlversion += "."; - sdlversion += Info.version.minor; - sdlversion += "."; - sdlversion += Info.version.patch; + sdlver += " on "; + sdlver += SDL_GetPlatform(); + } - Operator = new COSOperator(sdlversion); + Operator = new COSOperator(sdlver); if (SDLDeviceInstances == 1) { - os::Printer::log(sdlversion.c_str(), ELL_INFORMATION); + os::Printer::log(sdlver.c_str(), ELL_INFORMATION); } // create cursor control diff --git a/irr/src/CIrrDeviceSDL.h b/irr/src/CIrrDeviceSDL.h index eb2250f2a..fcf4608be 100644 --- a/irr/src/CIrrDeviceSDL.h +++ b/irr/src/CIrrDeviceSDL.h @@ -340,7 +340,6 @@ private: }; core::array KeyMap; - SDL_SysWMinfo Info; s32 CurrentTouchCount; bool IsInBackground;