From d6c3767043dbc21a54b1a39473b8da996f1f278b Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Thu, 22 Nov 2012 22:36:34 -0500 Subject: [PATCH] WinRT: pseudo-implemented SDLmain for WinRT. It has to be compiled directly into apps, for now. --- src/main/windowsrt/SDL_winrt_main.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/windowsrt/SDL_winrt_main.cpp diff --git a/src/main/windowsrt/SDL_winrt_main.cpp b/src/main/windowsrt/SDL_winrt_main.cpp new file mode 100644 index 000000000..9cc046de5 --- /dev/null +++ b/src/main/windowsrt/SDL_winrt_main.cpp @@ -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^) +{ + return SDL_WinRT_RunApplication(SDL_main); +}