From 62011c37f4c39422f126eb5090e2a5dd75a513d2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 17 Feb 2024 13:31:53 -0600 Subject: [PATCH] Fix build with SDL 2.0.20 and earlier Fixes #1186 --- app/streaming/input/abstouch.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/streaming/input/abstouch.cpp b/app/streaming/input/abstouch.cpp index fff12af3..04bacb52 100644 --- a/app/streaming/input/abstouch.cpp +++ b/app/streaming/input/abstouch.cpp @@ -114,6 +114,7 @@ void SdlInputHandler::handleAbsoluteFingerEvent(SDL_TouchFingerEvent* event) // Try to send it as a native pen/touch event, otherwise fall back to our touch emulation if (LiGetHostFeatureFlags() & LI_FF_PEN_TOUCH_EVENTS) { +#if SDL_VERSION_ATLEAST(2, 0, 22) bool isPen = false; int numTouchDevices = SDL_GetNumTouchDevices(); @@ -132,7 +133,9 @@ void SdlInputHandler::handleAbsoluteFingerEvent(SDL_TouchFingerEvent* event) LiSendPenEvent(eventType, LI_TOOL_TYPE_PEN, 0, vidrelx / dst.w, vidrely / dst.h, event->pressure, 0.0f, 0.0f, LI_ROT_UNKNOWN, LI_TILT_UNKNOWN); } - else { + else +#endif + { LiSendTouchEvent(eventType, pointerId, vidrelx / dst.w, vidrely / dst.h, event->pressure, 0.0f, 0.0f, LI_ROT_UNKNOWN); }