21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_WINRT 30 using Windows::UI::Core::CoreCursor;
36 #include "../../core/winrt/SDL_winrtapp_common.h" 37 #include "../../core/winrt/SDL_winrtapp_direct3d.h" 38 #include "../../core/winrt/SDL_winrtapp_xaml.h" 43 #include "../SDL_sysvideo.h" 44 #include "../../events/SDL_events_c.h" 49 static void WINRT_YieldXAMLThread();
60 WINRT_YieldXAMLThread();
67 enum SDL_XAMLAppThreadState
69 ThreadState_NotLaunched = 0,
74 static SDL_XAMLAppThreadState _threadState = ThreadState_NotLaunched;
80 WINRT_YieldXAMLThread()
83 SDL_assert(_threadState == ThreadState_Running);
84 _threadState = ThreadState_Yielding;
90 while (_threadState != ThreadState_Running) {
97 WINRT_XAMLThreadMain(
void * userdata)
107 WINRT_CycleXAMLThread()
109 switch (_threadState) {
110 case ThreadState_NotLaunched:
115 _threadState = ThreadState_Running;
116 _XAMLThread =
SDL_CreateThread(WINRT_XAMLThreadMain,
"SDL/XAML App Thread",
nullptr);
119 while (_threadState != ThreadState_Yielding) {
127 case ThreadState_Running:
133 case ThreadState_Yielding:
136 SDL_assert(_threadState == ThreadState_Yielding);
137 _threadState = ThreadState_Running;
143 while (_threadState != ThreadState_Yielding) {
SDL_WinRTApp SDL_WinRTGlobalApp
void WINRT_PumpEvents(_THIS)
#define SDL_assert(condition)
SDL_bool WINRT_XAMLWasEnabled
int(* WINRT_SDLAppEntryPoint)(int, char **)