Added some platform specific API functions for Android:

SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()
This commit is contained in:
Sam Lantinga 2012-11-02 02:22:32 -07:00
parent 1f23677ce4
commit ffc1360d69
2 changed files with 196 additions and 3 deletions

View file

@ -43,6 +43,11 @@ extern "C" {
/* *INDENT-ON* */
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/* Platform specific functions for iOS
/*
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#if __IPHONEOS__
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
@ -53,7 +58,47 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
#define SDL_iPhoneKeyboardToggle SDL_ToggleScreenKeyboard
#define SDL_iPhoneKeyboardIsShown SDL_IsScreenKeyboardShown
#endif
#endif /* __IPHONEOS__ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
/* Platform specific functions for Android
/*
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#if __ANDROID__
/* Get the JNI environment for the current thread
This returns JNIEnv*, but the prototype is void* so we don't need jni.h
*/
extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
/* Get the SDL Activity object for the application
This returns jobject, but the prototype is void* so we don't need jni.h
*/
extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
/* See the official Android developer guide for more information:
http://developer.android.com/guide/topics/data/data-storage.html
*/
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
/* Get the path used for internal storage for this application */
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
/* Get the current state of external storage, a bitmask of these values:
SDL_ANDROID_EXTERNAL_STORAGE_READ
SDL_ANDROID_EXTERNAL_STORAGE_WRITE
If external storage is currently unavailable, this will return 0.
*/
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
/* Get the path used for external storage for this application */
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
#endif /* __ANDROID__ */
/* Ends C function definitions when using C++ */
#ifdef __cplusplus