src/core/winrt/SDL_winrtapp_direct3d.cpp
changeset 10144 aa9904a56acf
parent 9998 f67cf37e9cd4
equal deleted inserted replaced
10143:14719cd1bde2 10144:aa9904a56acf
   252     CoreApplication::Resuming +=
   252     CoreApplication::Resuming +=
   253         ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnResuming);
   253         ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnResuming);
   254 
   254 
   255     CoreApplication::Exiting +=
   255     CoreApplication::Exiting +=
   256         ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnExiting);
   256         ref new EventHandler<Platform::Object^>(this, &SDL_WinRTApp::OnExiting);
       
   257 
       
   258 #if NTDDI_VERSION >= NTDDI_WIN10
       
   259     /* HACK ALERT!  Xbox One doesn't seem to detect gamepads unless something
       
   260        gets registered to receive Win10's Windows.Gaming.Input.Gamepad.GamepadAdded
       
   261        events.  We'll register an event handler for these events here, to make
       
   262        sure that gamepad detection works later on, if requested.
       
   263     */
       
   264     Windows::Gaming::Input::Gamepad::GamepadAdded +=
       
   265         ref new Windows::Foundation::EventHandler<Windows::Gaming::Input::Gamepad^>(
       
   266             this, &SDL_WinRTApp::OnGamepadAdded
       
   267         );
       
   268 #endif
   257 }
   269 }
   258 
   270 
   259 #if NTDDI_VERSION > NTDDI_WIN8
   271 #if NTDDI_VERSION > NTDDI_WIN8
   260 void SDL_WinRTApp::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
   272 void SDL_WinRTApp::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
   261 #else
   273 #else
   830 {
   842 {
   831     WINRT_OnBackButtonPressed(args);
   843     WINRT_OnBackButtonPressed(args);
   832 }
   844 }
   833 #endif
   845 #endif
   834 
   846 
       
   847 #if NTDDI_VERSION >= NTDDI_WIN10
       
   848 void SDL_WinRTApp::OnGamepadAdded(Platform::Object ^sender, Windows::Gaming::Input::Gamepad ^gamepad)
       
   849 {
       
   850     /* HACK ALERT: Nothing needs to be done here, as this method currently
       
   851        only exists to allow something to be registered with Win10's
       
   852        GamepadAdded event, an operation that seems to be necessary to get
       
   853        Xinput-based detection to work on Xbox One.
       
   854     */
       
   855 }
       
   856 #endif