Commit 3dde6e1e9fb660b98cd1b5d06a48142ebc8aa666

David Ludwig 2013-08-13T20:28:10

WinRT: made sure SDL_main gets used in the latest SDL 2.0.0 based code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/include/SDL_main.h b/include/SDL_main.h
index bbb7e85..21fedaa 100644
--- a/include/SDL_main.h
+++ b/include/SDL_main.h
@@ -39,6 +39,16 @@
  */
 #define SDL_MAIN_AVAILABLE
 
+#elif defined(__WINRT__)
+/* On Windows RT, SDL provides a main function that initializes CoreApplication,
+   creating an instance of IFrameworkView in the process.
+
+   Please note that #include'ing SDL_main.h is not enough to get a main()
+   function working.  The file, src/main/windowsrt/SDL_WinRT_main.cpp, or a copy
+   of it, must be compiled into the app itself.
+*/
+#define SDL_MAIN_NEEDED
+
 #elif defined(__IPHONEOS__)
 /* On iOS SDL provides a main function that creates an application delegate
    and starts the iOS application run loop.