aboutsummaryrefslogtreecommitdiff
path: root/examples/core_gestures_detection.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/core_gestures_detection.c')
-rw-r--r--examples/core_gestures_detection.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/core_gestures_detection.c b/examples/core_gestures_detection.c
index b69497c5..63a1e6bd 100644
--- a/examples/core_gestures_detection.c
+++ b/examples/core_gestures_detection.c
@@ -34,7 +34,7 @@ int main()
//SetGesturesEnabled(0b0000000000001001); // Enable only some gestures to be detected
- SetTargetFPS(30);
+ SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
@@ -43,12 +43,11 @@ int main()
// Update
//----------------------------------------------------------------------------------
lastGesture = currentGesture;
+ currentGesture = GetGestureDetected();
touchPosition = GetTouchPosition(0);
-
- if (CheckCollisionPointRec(touchPosition, touchArea) && IsGestureDetected())
+
+ if (CheckCollisionPointRec(touchPosition, touchArea) && (currentGesture != GESTURE_NONE))
{
- currentGesture = GetGestureType();
-
if (currentGesture != lastGesture)
{
// Store gesture string
@@ -62,6 +61,8 @@ int main()
case GESTURE_SWIPE_LEFT: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE LEFT"); break;
case GESTURE_SWIPE_UP: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE UP"); break;
case GESTURE_SWIPE_DOWN: strcpy(gestureStrings[gesturesCount], "GESTURE SWIPE DOWN"); break;
+ case GESTURE_PINCH_IN: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH IN"); break;
+ case GESTURE_PINCH_OUT: strcpy(gestureStrings[gesturesCount], "GESTURE PINCH OUT"); break;
default: break;
}
@@ -76,7 +77,6 @@ int main()
}
}
}
- else currentGesture = GESTURE_NONE;
//----------------------------------------------------------------------------------
// Draw