From a2b6244f543da5c80d2c4c0fbb8e9e7c631bb03b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 8 Jan 2024 23:51:34 +0100 Subject: [PATCH] Fix build with older SDL2 --- source/Irrlicht/CIrrDeviceSDL.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 140f924..50e4542 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -555,7 +555,11 @@ bool CIrrDeviceSDL::run() irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; +#if SDL_VERSION_ATLEAST(2, 0, 18) irrevent.MouseInput.Wheel = SDL_event.wheel.preciseY; +#else + irrevent.MouseInput.Wheel = SDL_event.wheel.y; +#endif irrevent.MouseInput.Shift = (keymod & KMOD_SHIFT) != 0; irrevent.MouseInput.Control = (keymod & KMOD_CTRL) != 0; irrevent.MouseInput.X = MouseX;