From 6e318dc8b20329290a4282872b945acd61e922b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 29 Apr 2023 12:34:25 +0200 Subject: [PATCH] Don't try to use precise mousewheel events on old SDL versions. Fixes compile-time compatibility with older version of SDL. --- SDL/SDLMain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 0a989aa419..d81157d83d 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -1171,6 +1171,7 @@ int main(int argc, char *argv[]) { KeyInput key; key.deviceId = DEVICE_ID_MOUSE; key.flags = KEY_DOWN; +#if SDL_VERSION_ATLEAST(2, 0, 18) if (event.wheel.preciseY != 0.0f) { // Should the scale be DPI-driven? const float scale = 30.0f; @@ -1184,6 +1185,7 @@ int main(int argc, char *argv[]) { NativeKey(key); break; } +#endif // TODO: Should we even keep the "non-precise" events? if (event.wheel.y > 0) { key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP;