Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added documentation on loading assets on Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Nov 4, 2012
1 parent dfa9336 commit 81cc7c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions README.android
Expand Up @@ -123,6 +123,22 @@ res directory.
You may need to change the name of your icon in AndroidManifest.xml to match
the filename used by Eclipse.

================================================================================
Loading assets
================================================================================

Any files you put in the "assets" directory of your android-project directory
will get bundled into the application package and you can load them using the
standard functions in SDL_rwops.h.

There are also a few Android specific functions that allow you to get other
useful paths for saving and loading data:
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()

See SDL_system.h for more details on these functions.

================================================================================
Pause / Resume behaviour
================================================================================
Expand Down
10 changes: 8 additions & 2 deletions include/SDL_system.h
Expand Up @@ -76,7 +76,10 @@ extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02

/* Get the path used for internal storage for this application */
/* Get the path used for internal storage for this application.
This path is unique to your application and cannot be written to
by other applications.
*/
extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();

/* Get the current state of external storage, a bitmask of these values:
Expand All @@ -86,7 +89,10 @@ extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
*/
extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();

/* Get the path used for external storage for this application */
/* Get the path used for external storage for this application.
This path is unique to your application, but is public and can be
written to by other applications.
*/
extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();

#endif /* __ANDROID__ */
Expand Down

0 comments on commit 81cc7c6

Please sign in to comment.