コード例 #1
0
ファイル: Gesture.cs プロジェクト: harry-cpp/sdl-sharp
        internal static void DispatchEvent(Native.SDL_Event e)
        {
            switch (e.Type)
            {
            case Native.SDL_EventType.MultiGesture:
            {
                MultiGesture?.Invoke(null, new MultiGestureEventArgs(e.Mgesture));
                break;
            }

            case Native.SDL_EventType.DollarGesture:
            {
                DollarGesture?.Invoke(null, new DollarGestureEventArgs(e.Dgesture));
                break;
            }

            case Native.SDL_EventType.DollarRecord:
            {
                DollarRecord?.Invoke(null, new DollarGestureEventArgs(e.Dgesture));
                break;
            }

            default:
                throw new InvalidOperationException();
            }
        }
コード例 #2
0
 /// <summary>
 /// Raises the <see cref="DollarGesture"/> event.
 /// </summary>
 /// <param name="gestureID">The unique identifier of the gesture which was performed.</param>
 /// <param name="x">The normalized x-coordinate of the gesture's centroid.</param>
 /// <param name="y">The normalized y-coordinate of the gesture's centroid.</param>
 /// <param name="error">The difference between the gesture template and the actual performed gesture; lower is better.</param>
 /// <param name="fingers">The number of fingers used to perform the gesture.</param>
 protected virtual void OnDollarGesture(Int64 gestureID, Single x, Single y, Single error, Int32 fingers)
 {
     DollarGesture?.Invoke(this, gestureID, x, y, error, fingers);
 }