src/events/SDL_gesture.c
changeset 11290 ef96b05151c5
parent 10945 1300a3135d61
child 11293 2759ce803a47
     1.1 --- a/src/events/SDL_gesture.c	Mon Aug 14 13:37:14 2017 -0700
     1.2 +++ b/src/events/SDL_gesture.c	Mon Aug 14 13:48:13 2017 -0700
     1.3 @@ -101,6 +101,12 @@
     1.4      return (touchId < 0);
     1.5  }
     1.6  
     1.7 +void SDL_GestureQuit()
     1.8 +{
     1.9 +    SDL_free(SDL_gestureTouch);
    1.10 +    SDL_gestureTouch = NULL;
    1.11 +}
    1.12 +
    1.13  static unsigned long SDL_HashDollar(SDL_FloatPoint* points)
    1.14  {
    1.15      unsigned long hash = 5381;
    1.16 @@ -457,6 +463,28 @@
    1.17      return 0;
    1.18  }
    1.19  
    1.20 +int SDL_GestureDelTouch(SDL_TouchID touchId)
    1.21 +{
    1.22 +    int i;
    1.23 +    for (i = 0; i < SDL_numGestureTouches; i++) {
    1.24 +        if (SDL_gestureTouch[i].id == touchId) {
    1.25 +            break;
    1.26 +        }
    1.27 +    }
    1.28 +
    1.29 +    if (i == SDL_numGestureTouches) {
    1.30 +        /* not found */
    1.31 +        return -1;
    1.32 +    }
    1.33 +
    1.34 +    SDL_free(SDL_gestureTouch[i].dollarTemplate);
    1.35 +    SDL_zero(SDL_gestureTouch[i]);
    1.36 +
    1.37 +    SDL_numGestureTouches--;
    1.38 +    SDL_gestureTouch[i] = SDL_gestureTouch[SDL_numGestureTouches];
    1.39 +    return 0;
    1.40 +}
    1.41 +
    1.42  static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id)
    1.43  {
    1.44      int i;