From d7ece7ee6ff03daf9a93bf8b9594bbc235adf02c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 17 Feb 2020 13:54:45 -0800 Subject: [PATCH] Made SDL_GetAndroidSDKVersion() available for applications --- include/SDL_system.h | 26 ++++++++++++++++++++++++++ src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + 3 files changed, 28 insertions(+) diff --git a/include/SDL_system.h b/include/SDL_system.h index 659e2eef9..d7974eb03 100644 --- a/include/SDL_system.h +++ b/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 */ diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index e9fbdd51e..a1d8e2eb1 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/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 diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 0173e2336..09388101b 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/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)