aboutsummaryrefslogtreecommitdiff
path: root/src/gestures.h
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-02-20 01:09:47 +0100
committerRay <raysan5@gmail.com>2016-02-20 01:09:47 +0100
commit4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf (patch)
treed9ee679c3b0bc5d4a20b31930994deb0e4c37948 /src/gestures.h
parentf582ab06add085594f2579ee6e7d625212abd204 (diff)
parent954ced21a42eb489ad382b4c00406a28778fee41 (diff)
downloadraylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.tar.gz
raylib-4b6e6d4dd45fc3a47b82af7eeb60871140a7eccf.zip
Merge pull request #83 from raysan5/develop
Develop branch integration
Diffstat (limited to 'src/gestures.h')
-rw-r--r--src/gestures.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/gestures.h b/src/gestures.h
index 896f3028..5468eb54 100644
--- a/src/gestures.h
+++ b/src/gestures.h
@@ -67,6 +67,17 @@ typedef enum {
GESTURE_PINCH_OUT = 1024
} Gestures;
+typedef enum { TOUCH_UP, TOUCH_DOWN, TOUCH_MOVE } TouchAction;
+
+// Gesture events
+// NOTE: MAX_TOUCH_POINTS fixed to 4
+typedef struct {
+ int touchAction;
+ int pointCount;
+ int pointerId[4];
+ Vector2 position[4];
+} GestureEvent;
+
#ifdef __cplusplus
extern "C" { // Prevents name mangling of functions
#endif
@@ -79,27 +90,20 @@ extern "C" { // Prevents name mangling of functions
//----------------------------------------------------------------------------------
// Module Functions Declaration
//----------------------------------------------------------------------------------
-int GetTouchX(void); // Returns touch position X (relative to screen size)
-int GetTouchY(void); // Returns touch position Y (relative to screen size)
-Vector2 GetTouchPosition(void); // Returns touch position XY (relative to screen size)
-
-#if defined(PLATFORM_WEB)
-void InitGesturesSystem(void); // Init gestures system (web)
-#elif defined(PLATFORM_ANDROID)
-void InitGesturesSystem(struct android_app *app); // Init gestures system (android)
-#endif
+void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures
void UpdateGestures(void); // Update gestures detected (must be called every frame)
bool IsGestureDetected(void); // Check if a gesture have been detected
int GetGestureType(void); // Get latest detected gesture
void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags
+int GetTouchPointsCount(void); // Get touch points count
-float GetGestureDragIntensity(void); // Get gesture drag intensity
-float GetGestureDragAngle(void); // Get gesture drag angle
+float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
Vector2 GetGestureDragVector(void); // Get gesture drag vector
-int GetGestureHoldDuration(void); // Get gesture hold time in frames
-float GetGesturePinchDelta(void); // Get gesture pinch delta
+float GetGestureDragAngle(void); // Get gesture drag angle
+Vector2 GetGesturePinchVector(void); // Get gesture pinch delta
float GetGesturePinchAngle(void); // Get gesture pinch angle
+
#ifdef __cplusplus
}
#endif