aboutsummaryrefslogtreecommitdiff
path: root/examples/core_gestures_detection.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-04-17 11:36:40 +0200
committerraysan5 <raysan5@gmail.com>2016-04-17 11:36:40 +0200
commit17eefed08fa052b39c9ee4c4cb486794a8551c92 (patch)
tree7bf325d93633663ff72a11ba8f919a184581fccb /examples/core_gestures_detection.c
parent2e5d898443767e027f0e1deab7ed3060085b62fd (diff)
downloadraylib-17eefed08fa052b39c9ee4c4cb486794a8551c92.tar.gz
raylib-17eefed08fa052b39c9ee4c4cb486794a8551c92.zip
Improved gestures system
Diffstat (limited to 'examples/core_gestures_detection.c')
-rw-r--r--examples/core_gestures_detection.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/core_gestures_detection.c b/examples/core_gestures_detection.c
index a5cf8e69..63a1e6bd 100644
--- a/examples/core_gestures_detection.c
+++ b/examples/core_gestures_detection.c
@@ -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
@@ -78,7 +77,6 @@ int main()
}
}
}
- else currentGesture = GESTURE_NONE;
//----------------------------------------------------------------------------------
// Draw