aboutsummaryrefslogtreecommitdiff
path: root/examples/core_gestures_detection.c
diff options
context:
space:
mode:
authorvictorfisac <victorfisac@gmail.com>2016-05-20 14:03:23 +0200
committervictorfisac <victorfisac@gmail.com>2016-05-20 14:03:23 +0200
commit4f1bee31654dec5f5cea2ac9d291d202df504745 (patch)
tree42a5028ebab3277a8d46bdcf3fea2990e1aa590d /examples/core_gestures_detection.c
parentea7afc8ec835040d84d79ae318f7aebb9f1e189c (diff)
parentdcf5f45f687f2a534286aecd5e6471a0440b0c21 (diff)
downloadraylib-4f1bee31654dec5f5cea2ac9d291d202df504745.tar.gz
raylib-4f1bee31654dec5f5cea2ac9d291d202df504745.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
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