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

Commit

Permalink
WinRT: added a function to retrieve the root path to the installed app
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLudwig committed Feb 3, 2013
1 parent 03c860f commit b90f843
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/SDL_system.h
Expand Up @@ -96,6 +96,12 @@ extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
/* Platform specific functions for Windows RT */
#if defined(__WINRT__) && __WINRT__

/* Gets the path to the installed app's root directory.
This function may be used safely on Windows Phone 8.
*/
extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetInstalledLocationPath();

/* Gets the path to the local app data store.
Files and directories that should be limited to the local device can be
created in this path.
Expand Down
10 changes: 10 additions & 0 deletions src/core/windowsrt/SDL_winrtpaths.cpp
Expand Up @@ -29,6 +29,16 @@ WINRT_CopySystemPath(Windows::Storage::StorageFolder ^ folder)
return destPath;
}

extern "C" const wchar_t *
SDL_WinRTGetInstalledLocationPath()
{
static const wchar_t * path = nullptr;
if (!path) {
path = WINRT_CopySystemPath(Windows::ApplicationModel::Package::Current->InstalledLocation);
}
return path;
}

extern "C" const wchar_t *
SDL_WinRTGetLocalFolderPath()
{
Expand Down

0 comments on commit b90f843

Please sign in to comment.