src/video/winrt/SDL_winrtmouse.cpp
changeset 8505 a76a3842c9eb
parent 8500 f25ef28d61e8
child 8511 326b43e1276b
     1.1 --- a/src/video/winrt/SDL_winrtmouse.cpp	Tue Aug 27 13:03:43 2013 -0400
     1.2 +++ b/src/video/winrt/SDL_winrtmouse.cpp	Tue Aug 27 21:21:09 2013 -0400
     1.3 @@ -110,6 +110,11 @@
     1.4  static int
     1.5  WINRT_ShowCursor(SDL_Cursor * cursor)
     1.6  {
     1.7 +    // TODO, WinRT, XAML: make WINRT_ShowCursor work when XAML support is enabled.
     1.8 +    if ( ! CoreWindow::GetForCurrentThread()) {
     1.9 +        return 0;
    1.10 +    }
    1.11 +
    1.12      if (cursor) {
    1.13          CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata;
    1.14          CoreWindow::GetForCurrentThread()->PointerCursor = *theCursor;
    1.15 @@ -334,25 +339,25 @@
    1.16  }
    1.17  
    1.18  void
    1.19 -WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
    1.20 +WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint)
    1.21  {
    1.22  #if LOG_POINTER_EVENTS
    1.23 -    WINRT_LogPointerEvent("pointer moved", args, TransformCursor(args->CurrentPoint->Position));
    1.24 +    WINRT_LogPointerEvent("pointer moved", args, TransformCursor(pointerPoint->Position));
    1.25  #endif
    1.26  
    1.27      if (!window || WINRT_UseRelativeMouseMode) {
    1.28          return;
    1.29      }
    1.30  
    1.31 -    Windows::Foundation::Point transformedPoint = TransformCursor(window, args->CurrentPoint->Position);
    1.32 +    Windows::Foundation::Point transformedPoint = TransformCursor(window, pointerPoint->Position);
    1.33      SDL_SendMouseMotion(window, 0, 0, (int)transformedPoint.X, (int)transformedPoint.Y);
    1.34  }
    1.35  
    1.36  void
    1.37 -WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
    1.38 +WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint)
    1.39  {
    1.40  #if LOG_POINTER_EVENTS
    1.41 -    WINRT_LogPointerEvent("wheel changed", args, TransformCursor(args->CurrentPoint->Position));
    1.42 +    WINRT_LogPointerEvent("wheel changed", args, TransformCursor(pointerPoint->Position));
    1.43  #endif
    1.44  
    1.45      if (!window) {
    1.46 @@ -360,11 +365,11 @@
    1.47      }
    1.48  
    1.49      // FIXME: This may need to accumulate deltas up to WHEEL_DELTA
    1.50 -    short motion = args->CurrentPoint->Properties->MouseWheelDelta / WHEEL_DELTA;
    1.51 +    short motion = pointerPoint->Properties->MouseWheelDelta / WHEEL_DELTA;
    1.52      SDL_SendMouseWheel(window, 0, 0, motion);
    1.53  }
    1.54  
    1.55 -void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
    1.56 +void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint)
    1.57  {
    1.58  #if LOG_POINTER_EVENTS
    1.59      WINRT_LogPointerEvent("mouse up", args, TransformCursor(args->CurrentPoint->Position));
    1.60 @@ -374,13 +379,13 @@
    1.61          return;
    1.62      }
    1.63  
    1.64 -    Uint8 button = WINRT_GetSDLButtonForPointerPoint(args->CurrentPoint);
    1.65 +    Uint8 button = WINRT_GetSDLButtonForPointerPoint(pointerPoint);
    1.66      if (button) {
    1.67          SDL_SendMouseButton(window, 0, SDL_RELEASED, button);
    1.68      }
    1.69  }
    1.70  
    1.71 -void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
    1.72 +void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^pointerPoint)
    1.73  {
    1.74  #if LOG_POINTER_EVENTS
    1.75      WINRT_LogPointerEvent("mouse down", args, TransformCursor(args->CurrentPoint->Position));
    1.76 @@ -390,7 +395,7 @@
    1.77          return;
    1.78      }
    1.79  
    1.80 -    Uint8 button = WINRT_GetSDLButtonForPointerPoint(args->CurrentPoint);
    1.81 +    Uint8 button = WINRT_GetSDLButtonForPointerPoint(pointerPoint);
    1.82      if (button) {
    1.83          SDL_SendMouseButton(window, 0, SDL_PRESSED, button);
    1.84      }