Fix Gestures to use GetTime() if it's available (#2733)

This commit is contained in:
Rob Loach 2022-10-02 04:47:17 -04:00 committed by GitHub
parent 03f5fce672
commit 0daaaddeef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,6 +151,7 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
#if defined(GESTURES_IMPLEMENTATION)
#if defined(GESTURES_STANDALONE)
#if defined(_WIN32)
#if defined(__cplusplus)
extern "C" { // Prevents name mangling of functions
@ -175,6 +176,7 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
#include <mach/clock.h> // Required for: clock_get_time()
#include <mach/mach.h> // Required for: mach_timespec_t
#endif
#endif
//----------------------------------------------------------------------------------
// Defines and Macros
@ -526,6 +528,9 @@ static double rgGetCurrentTime(void)
{
double time = 0;
#if !defined(GESTURES_STANDALONE)
time = GetTime();
#else
#if defined(_WIN32)
unsigned long long int clockFrequency, currentTime;
@ -558,6 +563,7 @@ static double rgGetCurrentTime(void)
unsigned long long int nowTime = (unsigned long long int)now.tv_sec*1000000000LLU + (unsigned long long int)now.tv_nsec; // Time in nanoseconds
time = ((double)nowTime/1000000.0); // Time in miliseconds
#endif
#endif
return time;