WinRT: added a function to retrieve the root path to the installed app
authorDavid Ludwig <dludwig@pobox.com>
Sun, 03 Feb 2013 12:49:12 -0500
changeset 8405fe893b2d6f4d
parent 8404 47cfa104ad27
child 8406 a3244b2eefcd
WinRT: added a function to retrieve the root path to the installed app
include/SDL_system.h
src/core/windowsrt/SDL_winrtpaths.cpp
     1.1 --- a/include/SDL_system.h	Sun Feb 03 12:38:55 2013 -0500
     1.2 +++ b/include/SDL_system.h	Sun Feb 03 12:49:12 2013 -0500
     1.3 @@ -96,6 +96,12 @@
     1.4  /* Platform specific functions for Windows RT */
     1.5  #if defined(__WINRT__) && __WINRT__
     1.6  
     1.7 +/* Gets the path to the installed app's root directory.
     1.8 +
     1.9 +   This function may be used safely on Windows Phone 8.
    1.10 +*/
    1.11 +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetInstalledLocationPath();
    1.12 +
    1.13  /* Gets the path to the local app data store.
    1.14     Files and directories that should be limited to the local device can be
    1.15     created in this path.
     2.1 --- a/src/core/windowsrt/SDL_winrtpaths.cpp	Sun Feb 03 12:38:55 2013 -0500
     2.2 +++ b/src/core/windowsrt/SDL_winrtpaths.cpp	Sun Feb 03 12:49:12 2013 -0500
     2.3 @@ -30,6 +30,16 @@
     2.4  }
     2.5  
     2.6  extern "C" const wchar_t *
     2.7 +SDL_WinRTGetInstalledLocationPath()
     2.8 +{
     2.9 +    static const wchar_t * path = nullptr;
    2.10 +    if (!path) {
    2.11 +        path = WINRT_CopySystemPath(Windows::ApplicationModel::Package::Current->InstalledLocation);
    2.12 +    }
    2.13 +    return path;
    2.14 +}
    2.15 +
    2.16 +extern "C" const wchar_t *
    2.17  SDL_WinRTGetLocalFolderPath()
    2.18  {
    2.19      static const wchar_t * path = nullptr;