Browse Source

Made SDL_GetAndroidSDKVersion() available for applications

Sam Lantinga 5 years ago
parent
commit
d7ece7ee6f
3 changed files with 28 additions and 0 deletions
  1. 26 0
      include/SDL_system.h
  2. 1 0
      src/dynapi/SDL_dynapi_overrides.h
  3. 1 0
      src/dynapi/SDL_dynapi_procs.h

+ 26 - 0
include/SDL_system.h

@@ -120,6 +120,32 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
  */
 extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
 
+/**
+   \brief Return API level of the current device
+
+    API level 29: Android 10
+    API level 28: Android 9
+    API level 27: Android 8.1
+    API level 26: Android 8.0
+    API level 25: Android 7.1
+    API level 24: Android 7.0
+    API level 23: Android 6.0
+    API level 22: Android 5.1
+    API level 21: Android 5.0
+    API level 20: Android 4.4W
+    API level 19: Android 4.4
+    API level 18: Android 4.3
+    API level 17: Android 4.2
+    API level 16: Android 4.1
+    API level 15: Android 4.0.3
+    API level 14: Android 4.0
+    API level 13: Android 3.2
+    API level 12: Android 3.1
+    API level 11: Android 3.0
+    API level 10: Android 2.3.3
+ */
+extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
+
 /**
    \brief Return true if the application is running on Android TV
  */

+ 1 - 0
src/dynapi/SDL_dynapi_overrides.h

@@ -746,3 +746,4 @@
 #define SDL_OnApplicationWillEnterForeground SDL_OnApplicationWillEnterForeground_REAL
 #define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidBecomeActive_REAL
 #define SDL_OnApplicationDidChangeStatusBarOrientation SDL_OnApplicationDidChangeStatusBarOrientation_REAL
+#define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL

+ 1 - 0
src/dynapi/SDL_dynapi_procs.h

@@ -804,3 +804,4 @@ SDL_DYNAPI_PROC(void,SDL_OnApplicationDidBecomeActive,(void),(),)
 #ifdef __IPHONEOS__
 SDL_DYNAPI_PROC(void,SDL_OnApplicationDidChangeStatusBarOrientation,(void),(),)
 #endif
+SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)