21#include "../../SDL_internal.h"
23#if SDL_VIDEO_DRIVER_WINRT
29using namespace Windows::UI::Core;
30using 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"
50static void WINRT_YieldXAMLThread();
61 WINRT_YieldXAMLThread();
68enum SDL_XAMLAppThreadState
70 ThreadState_NotLaunched = 0,
75static SDL_XAMLAppThreadState _threadState = ThreadState_NotLaunched;
81WINRT_YieldXAMLThread()
84 SDL_assert(_threadState == ThreadState_Running);
85 _threadState = ThreadState_Yielding;
91 while (_threadState != ThreadState_Running) {
98WINRT_XAMLThreadMain(
void * userdata)
108WINRT_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) {
#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)