Browse Source

Added GetGestureDetected() again...

Required by gestures example....
pull/132/head
raysan5 8 years ago
parent
commit
3d6be7fd80
3 changed files with 19 additions and 10 deletions
  1. +17
    -10
      src/gestures.c
  2. +1
    -0
      src/gestures.h
  3. +1
    -0
      src/raylib.h

+ 17
- 10
src/gestures.c View File

@ -111,6 +111,19 @@ static double GetCurrentTime(void);
// Module Functions Definition
//----------------------------------------------------------------------------------
// Enable only desired getures to be detected
void SetGesturesEnabled(unsigned int gestureFlags)
{
enabledGestures = gestureFlags;
}
// Check if a gesture have been detected
bool IsGestureDetected(int gesture)
{
if ((enabledGestures & currentGesture) == gesture) return true;
else return false;
}
// Process gesture event and translate it into gestures
void ProcessGestureEvent(GestureEvent event)
{
@ -291,13 +304,6 @@ void UpdateGestures(void)
}
}
// Check if a gesture have been detected
bool IsGestureDetected(int gesture)
{
if ((enabledGestures & currentGesture) == gesture) return true;
else return false;
}
// Get number of touch points
int GetTouchPointsCount(void)
{
@ -306,10 +312,11 @@ int GetTouchPointsCount(void)
return pointCount;
}
// Enable only desired getures to be detected
void SetGesturesEnabled(unsigned int gestureFlags)
// Get latest detected gesture
int GetGestureDetected(void)
{
enabledGestures = gestureFlags;
// Get current gesture only if enabled
return (enabledGestures & currentGesture);
}
// Hold time measured in ms

+ 1
- 0
src/gestures.h View File

@ -96,6 +96,7 @@ void ProcessGestureEvent(GestureEvent event); // Process gesture event
void UpdateGestures(void); // Update gestures detected (must be called every frame)
int GetTouchPointsCount(void); // Get touch points count
int GetGestureDetected(void); // Get latest detected gesture
float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
Vector2 GetGestureDragVector(void); // Get gesture drag vector
float GetGestureDragAngle(void); // Get gesture drag angle

+ 1
- 0
src/raylib.h View File

@ -650,6 +650,7 @@ void ProcessGestureEvent(GestureEvent event); // Process gesture event
void UpdateGestures(void); // Update gestures detected (called automatically in PollInputEvents())
int GetTouchPointsCount(void); // Get touch points count
int GetGestureDetected(void); // Get latest detected gesture
float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds
Vector2 GetGestureDragVector(void); // Get gesture drag vector
float GetGestureDragAngle(void); // Get gesture drag angle

Loading…
Cancel
Save