21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_WINRT
29 using namespace Windows::UI::Core;
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"
42 #include "../../thread/SDL_systhread.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(
void)
109 switch (_threadState) {
110 case ThreadState_NotLaunched:
115 _threadState = ThreadState_Running;
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) {
#define SDL_assert(condition)
SDL_Thread * SDL_CreateThreadInternal(int(*fn)(void *), const char *name, const size_t stacksize, void *data)
int(* WINRT_SDLAppEntryPoint)(int, char **)
SDL_WinRTApp SDL_WinRTGlobalApp
SDL_bool WINRT_XAMLWasEnabled
void WINRT_PumpEvents(_THIS)