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 "../../thread/SDL_systhread.h" 44 #include "../SDL_sysvideo.h" 45 #include "../../events/SDL_events_c.h" 50 static void WINRT_YieldXAMLThread();
61 WINRT_YieldXAMLThread();
68 enum SDL_XAMLAppThreadState
70 ThreadState_NotLaunched = 0,
75 static SDL_XAMLAppThreadState _threadState = ThreadState_NotLaunched;
81 WINRT_YieldXAMLThread()
84 SDL_assert(_threadState == ThreadState_Running);
85 _threadState = ThreadState_Yielding;
91 while (_threadState != ThreadState_Running) {
98 WINRT_XAMLThreadMain(
void * userdata)
108 WINRT_CycleXAMLThread(
void)
110 switch (_threadState) {
111 case ThreadState_NotLaunched:
116 _threadState = ThreadState_Running;
120 while (_threadState != ThreadState_Yielding) {
128 case ThreadState_Running:
134 case ThreadState_Yielding:
137 SDL_assert(_threadState == ThreadState_Yielding);
138 _threadState = ThreadState_Running;
144 while (_threadState != ThreadState_Yielding) {
SDL_WinRTApp SDL_WinRTGlobalApp
SDL_Thread * SDL_CreateThreadInternal(int(*fn)(void *), const char *name, const size_t stacksize, void *data)
void WINRT_PumpEvents(_THIS)
#define SDL_assert(condition)
SDL_bool WINRT_XAMLWasEnabled
int(* WINRT_SDLAppEntryPoint)(int, char **)