aboutsummaryrefslogtreecommitdiff
path: root/src/gestures.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-05-21 00:18:22 +0200
committerraysan5 <raysan5@gmail.com>2015-05-21 00:18:22 +0200
commit9e450df053c9b6f13a89553d65425c350d4399dd (patch)
tree93008f4c5d2464778d16d7af130807c5ad93cbd4 /src/gestures.c
parentc7ae28aaa2d2cb0da8bf3892720f5cb12ccb56ba (diff)
downloadraylib-9e450df053c9b6f13a89553d65425c350d4399dd.tar.gz
raylib-9e450df053c9b6f13a89553d65425c350d4399dd.zip
Added extensions check on rlglInit() and more
Corrected shader version depending on OGL version Corrected bug in gestures module
Diffstat (limited to 'src/gestures.c')
-rw-r--r--src/gestures.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gestures.c b/src/gestures.c
index 2574aa02..55bae328 100644
--- a/src/gestures.c
+++ b/src/gestures.c
@@ -531,6 +531,7 @@ static float DotProduct(Vector2 v1, Vector2 v2)
static double GetCurrentTime()
{
+ double time = 0;
#if defined(_WIN32)
/*
// NOTE: Requires Windows.h
@@ -538,7 +539,7 @@ static double GetCurrentTime()
GetSystemTimePreciseAsFileTime(&tm);
ULONGLONG nowTime = ((ULONGLONG)tm.dwHighDateTime << 32) | (ULONGLONG)tm.dwLowDateTime; // Time provided in 100-nanosecond intervals
- return ((double)nowTime/10000000.0); // Return time in seconds
+ time = ((double)nowTime/10000000.0); // time in seconds
*/
#endif
@@ -548,8 +549,10 @@ static double GetCurrentTime()
clock_gettime(CLOCK_MONOTONIC, &now);
uint64_t nowTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; // Time provided in nanoseconds
- return ((double)nowTime/1000000.0); // Return time in miliseconds
+ time = ((double)nowTime/1000000.0); // time in miliseconds
#endif
+
+ return time;
}
#if defined(PLATFORM_ANDROID)
@@ -618,9 +621,6 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent
t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY);
}
*/
-
- touchPosition = gestureEvent.position[0];
-
GestureEvent gestureEvent;
// Action
@@ -635,6 +635,8 @@ static EM_BOOL EmscriptenInputCallback(int eventType, const EmscriptenTouchEvent
gestureEvent.position[0] = (Vector2){ touchEvent->touches[0].canvasX, touchEvent->touches[0].canvasY };
gestureEvent.position[1] = (Vector2){ touchEvent->touches[1].canvasX, touchEvent->touches[1].canvasY };
+ touchPosition = gestureEvent.position[0];
+
ProcessMotionEvent(gestureEvent);
return 1;