Sfoglia il codice sorgente

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

pull/2736/head
Rob Loach 2 anni fa
committed by GitHub
parent
commit
0daaaddeef
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. +6
    -0
      src/rgestures.h

+ 6
- 0
src/rgestures.h Vedi 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;

Caricamento…
Annulla
Salva