url: WinRT actually works now (and has been tested, hooray!).
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 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
index 14619dd..e4ec4e4 100644
--- a/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
+++ b/VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
@@ -438,6 +438,9 @@
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h">
<Filter>Source Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\SDL_misc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c">
@@ -791,5 +794,11 @@
<ClCompile Include="..\..\src\events\SDL_displayevents.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\misc\winrt\SDL_sysurl.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\misc\SDL_url.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/misc/winrt/SDL_sysurl.cpp b/src/misc/winrt/SDL_sysurl.cpp
index 69393cb..d2bd4de 100644
--- a/src/misc/winrt/SDL_sysurl.cpp
+++ b/src/misc/winrt/SDL_sysurl.cpp
@@ -21,17 +21,22 @@
#include <Windows.h>
+#include "../../core/windows/SDL_windows.h"
#include "../SDL_sysurl.h"
int
SDL_SYS_OpenURL(const char *url)
{
- Platform::String^ strurl = url;
+ WCHAR *wurl = WIN_UTF8ToString(url);
+ if (!wurl) {
+ return SDL_OutOfMemory();
+ }
+ auto strurl = ref new Platform::String(wurl);
SDL_free(wurl);
auto uri = ref new Windows::Foundation::Uri(strurl);
- launchUriOperation(Windows::System::Launcher::LaunchUriAsync(uri));
- return 0;
+ Windows::System::Launcher::LaunchUriAsync(uri);
+ return 0; // oh well, we're not waiting on an async task here.
}
/* vi: set ts=4 sw=4 expandtab: */