21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_WINRT 27 #include <windows.foundation.h> 28 #include <EventToken.h> 34 #include "../SDL_sysvideo.h" 42 static Platform::WeakReference WINRT_MainThreadDispatcher;
51 MIDL_INTERFACE(
"1DB9A292-CC78-4173-BE45-B61E67283EA7")
52 IGameBarStatics_ : public IInspectable
55 virtual HRESULT STDMETHODCALLTYPE add_VisibilityChanged(
56 __FIEventHandler_1_IInspectable *handler,
57 Windows::Foundation::EventRegistrationToken *token) = 0;
59 virtual HRESULT STDMETHODCALLTYPE remove_VisibilityChanged(
60 Windows::Foundation::EventRegistrationToken token) = 0;
62 virtual HRESULT STDMETHODCALLTYPE add_IsInputRedirectedChanged(
63 __FIEventHandler_1_IInspectable *handler,
64 Windows::Foundation::EventRegistrationToken *token) = 0;
66 virtual HRESULT STDMETHODCALLTYPE remove_IsInputRedirectedChanged(
67 Windows::Foundation::EventRegistrationToken token) = 0;
69 virtual HRESULT STDMETHODCALLTYPE get_Visible(
72 virtual HRESULT STDMETHODCALLTYPE get_IsInputRedirected(
77 static GUID IID_IGameBarStatics_ = { MAKELONG(0xA292, 0x1DB9), 0xCC78, 0x4173, { 0xBE, 0x45, 0xB6, 0x1E, 0x67, 0x28, 0x3E, 0xA7 } };
83 static IGameBarStatics_ *
86 wchar_t *wClassName = L
"Windows.Gaming.UI.GameBar";
88 IActivationFactory *pActivationFactory =
NULL;
89 IGameBarStatics_ *pGameBar =
NULL;
92 hr = ::WindowsCreateString(wClassName, (UINT32)wcslen(wClassName), &hClassName);
97 hr = Windows::Foundation::GetActivationFactory(hClassName, &pActivationFactory);
102 pActivationFactory->QueryInterface(IID_IGameBarStatics_, (
void **) &pGameBar);
105 if (pActivationFactory) {
106 pActivationFactory->Release();
109 ::WindowsDeleteString(hClassName);
115 WINRT_HandleGameBarIsInputRedirected_MainThread()
117 IGameBarStatics_ *gameBar;
118 boolean isInputRedirected = 0;
119 if (!WINRT_MainThreadDispatcher) {
123 gameBar = WINRT_GetGameBar();
128 if (
SUCCEEDED(gameBar->get_IsInputRedirected(&isInputRedirected))) {
129 if ( ! isInputRedirected) {
142 WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object ^ o1, Platform::Object ^o2)
144 Windows::UI::Core::CoreDispatcher ^dispatcher = WINRT_MainThreadDispatcher.Resolve<Windows::UI::Core::CoreDispatcher>();
146 dispatcher->RunAsync(
147 Windows::UI::Core::CoreDispatcherPriority::Normal,
148 ref new Windows::UI::Core::DispatchedHandler(&WINRT_HandleGameBarIsInputRedirected_MainThread));
153 WINRT_InitGameBar(
_THIS)
156 IGameBarStatics_ *gameBar = WINRT_GetGameBar();
164 WINRT_MainThreadDispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher;
165 Windows::Foundation::EventHandler<Platform::Object ^> ^handler = \
166 ref
new Windows::Foundation::EventHandler<Platform::Object ^>(&WINRT_HandleGameBarIsInputRedirected_NonMainThread);
167 __FIEventHandler_1_IInspectable * pHandler =
reinterpret_cast<__FIEventHandler_1_IInspectable *
>(handler);
174 WINRT_QuitGameBar(
_THIS)
177 IGameBarStatics_ *gameBar;
181 gameBar = WINRT_GetGameBar();
190 WINRT_MainThreadDispatcher =
nullptr;
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
static SDL_VideoDevice * _this
HRESULT(WINAPI *GetDpiForMonitor)(HMONITOR hmonitor
GLsizei const GLfloat * value
Windows::Foundation::EventRegistrationToken gameBarIsInputRedirectedToken