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 8405 fe893b2d6f4d
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
--- a/include/SDL_system.h	Sun Feb 03 12:38:55 2013 -0500
+++ b/include/SDL_system.h	Sun Feb 03 12:49:12 2013 -0500
@@ -96,6 +96,12 @@
 /* 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.
--- a/src/core/windowsrt/SDL_winrtpaths.cpp	Sun Feb 03 12:38:55 2013 -0500
+++ b/src/core/windowsrt/SDL_winrtpaths.cpp	Sun Feb 03 12:49:12 2013 -0500
@@ -30,6 +30,16 @@
 }
 
 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()
 {
     static const wchar_t * path = nullptr;