aboutsummaryrefslogtreecommitdiff
path: root/src/raylib.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/raylib.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/raylib.h')
-rw-r--r--src/raylib.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 1113958d..864a240a 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -70,7 +70,7 @@
#endif
#if defined(PLATFORM_ANDROID)
- #include <android_native_app_glue.h> // Defines android_app struct
+ typedef struct android_app; // Define android_app struct (android_native_app_glue.h)
#endif
//----------------------------------------------------------------------------------
@@ -432,6 +432,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;
+
// Camera system modes
typedef enum { CAMERA_CUSTOM = 0, CAMERA_FREE, CAMERA_ORBITAL, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON } CameraMode;
@@ -571,16 +582,11 @@ Vector2 GetTouchPosition(void); // Returns touch positio
//------------------------------------------------------------------------------------
// Gestures and Touch Handling Functions (Module: gestures)
//------------------------------------------------------------------------------------
-Vector2 GetRawTouchPosition(void); // Get touch position (raw)
-#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