Skip to content

Instantly share code, notes, and snippets.

@dilworks
Created January 18, 2021 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilworks/89273c5976b1a91ba19fbd75db204293 to your computer and use it in GitHub Desktop.
Save dilworks/89273c5976b1a91ba19fbd75db204293 to your computer and use it in GitHub Desktop.
diff --git a/SonicCDDecomp/RetroEngine.hpp b/SonicCDDecomp/RetroEngine.hpp
index 7cd77c3..76c1161 100644
--- a/SonicCDDecomp/RetroEngine.hpp
+++ b/SonicCDDecomp/RetroEngine.hpp
@@ -104,6 +104,27 @@ typedef unsigned int uint;
#endif
+//
+#if RETRO_USING_SDL
+#include <SDL2/SDL.h>
+#if !(SDL_VERSION_ATLEAST(2,0,10))
+typedef enum
+{
+ SDL_TOUCH_DEVICE_INVALID = -1,
+ SDL_TOUCH_DEVICE_DIRECT, // touch screen with window-relative coordinates
+ SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, // trackpad with absolute device coordinates
+ SDL_TOUCH_DEVICE_INDIRECT_RELATIVE // trackpad with screen cursor-relative coordinates
+} SDL_TouchDeviceType;
+#if defined(WARN_OUTDATED)
+#pragma message("SDL_GetTouchDeviceType is not supported before SDL 2.0.10")
+#endif
+static inline SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID)
+{
+ return SDL_TOUCH_DEVICE_INVALID;
+}
+#endif
+#endif
+
// this macro defines the touch device read by the game (UWP requires DIRECT)
#if RETRO_UWP
#define RETRO_TOUCH_DEVICE SDL_TOUCH_DEVICE_DIRECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment