WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
authorDavid Ludwig <dludwig@pobox.com>
Thu, 22 Nov 2012 22:36:34 -0500
changeset 8355 f73480bf3e55
parent 8354 c086e9e73916
child 8356 4d85eba58f0a
WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now.
src/main/windowsrt/SDL_winrt_main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/windowsrt/SDL_winrt_main.cpp	Thu Nov 22 22:36:34 2012 -0500
@@ -0,0 +1,14 @@
+
+//#include "pch.h"
+
+// The app's C-style main will be passed into SDL.dll as a function
+// pointer, and called at the appropriate time.
+typedef int (*SDLmain_MainFunction)(int, char **);
+extern __declspec(dllimport) int SDL_WinRT_RunApplication(SDLmain_MainFunction mainFunction);
+extern "C" int SDL_main(int, char **);
+
+[Platform::MTAThread]
+int main(Platform::Array<Platform::String^>^)
+{
+    return SDL_WinRT_RunApplication(SDL_main);
+}