aboutsummaryrefslogtreecommitdiff
path: root/src/gestures.h
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-01-03 13:01:21 +0100
committerraysan5 <raysan5@gmail.com>2016-01-03 13:01:21 +0100
commitd32feaa6685584e9856aa94f4d5bf80b7f5b861c (patch)
treea2531dc7fc7baafc1ef649a73062b17e321de0a1 /src/gestures.h
parentf269fb46eaa446fd07baf672d6d7f97f5035e6c2 (diff)
downloadraylib-d32feaa6685584e9856aa94f4d5bf80b7f5b861c.tar.gz
raylib-d32feaa6685584e9856aa94f4d5bf80b7f5b861c.zip
Reviewed Android inputs and gestures system
Corrected Android processing for some inputs (BACK button, VOLUME buttons) Redesigned Gestures system (some work still required) SetEnabledGestures() - Only support desired gestures (requires some review)
Diffstat (limited to 'src/gestures.h')
-rw-r--r--src/gestures.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gestures.h b/src/gestures.h
index 896f3028..b5cf2767 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,19 +90,11 @@ 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 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
+void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures
float GetGestureDragIntensity(void); // Get gesture drag intensity
float GetGestureDragAngle(void); // Get gesture drag angle