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

Latest commit

 

History

History
45 lines (37 loc) · 1.22 KB

SDL_winrtpaths.cpp

File metadata and controls

45 lines (37 loc) · 1.22 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* TODO, WinRT: include copyright info in SDL_winrtpaths.cpp
TODO, WinRT: add note to SDL_winrtpaths.cpp mentioning that /ZW must be used when compiling the file
*/
#include "SDL_config.h"
#ifdef __WINRT__
extern "C" {
#include "SDL_system.h"
#include "../windows/SDL_windows.h"
}
using namespace Windows::Storage;
extern "C" const char * SDL_WinRTGetLocalFolderPath()
{
static const char * path = nullptr;
if (!path) {
path = WIN_StringToUTF8(ApplicationData::Current->LocalFolder->Path->Data());
}
return path;
}
extern "C" const char * SDL_WinRTGetRoamingFolderPath()
{
// TODO, WinRT: make SDL_WinRTGetRoamingFolderPath return NULL on Windows Phone 8
static const char * path = nullptr;
if (!path) {
path = WIN_StringToUTF8(ApplicationData::Current->RoamingFolder->Path->Data());
}
return path;
}
extern "C" const char * SDL_WinRTGetTemporaryFolderPath()
{
// TODO, WinRT: make SDL_WinRTGetTemporaryFolderPath return NULL on Windows Phone 8
static const char * path = nullptr;
if (!path) {
path = WIN_StringToUTF8(ApplicationData::Current->TemporaryFolder->Path->Data());
}
return path;
}
#endif /* __WINRT__ */