OpenAL is no more

This commit is contained in:
Milan Nikolic 2017-12-05 19:45:13 +01:00
parent 275bcd3efc
commit 1923507276
25 changed files with 18868 additions and 1893 deletions

View file

@ -140,17 +140,25 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
#if defined(GESTURES_IMPLEMENTATION)
#include <math.h> // Required for: atan2(), sqrt()
#include <stdint.h> // Required for: uint64_t
#if defined(_WIN32)
// Functions required to query time on Windows
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
#elif defined(__linux__)
//#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
#if _POSIX_C_SOURCE < 199309L
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199309L // Required for CLOCK_MONOTONIC if compiled with c99 without gnu ext.
#endif
#include <sys/time.h> // Required for: timespec
#include <time.h> // Required for: clock_gettime()
#include <math.h> // Required for: atan2(), sqrt()
#include <stdint.h> // Required for: uint64_t
#endif
#if defined(__APPLE__) // macOS also defines __MACH__
#include <mach/clock.h> // Required for: clock_get_time()
#include <mach/mach.h> // Required for: mach_timespec_t
#endif
//----------------------------------------------------------------------------------
@ -529,6 +537,22 @@ static double GetCurrentTime(void)
time = ((double)nowTime/1000000.0); // Time in miliseconds
#endif
#if defined(__APPLE__)
//#define CLOCK_REALTIME CALENDAR_CLOCK
//#define CLOCK_MONOTONIC SYSTEM_CLOCK
clock_serv_t cclock;
mach_timespec_t now;
host_get_clock_service(mach_host_self(), SYSTEM_CLOCK, &cclock);
// NOTE: OS X does not have clock_gettime(), using clock_get_time()
clock_get_time(cclock, &now);
mach_port_deallocate(mach_task_self(), cclock);
uint64_t nowTime = (uint64_t)now.tv_sec*1000000000LLU + (uint64_t)now.tv_nsec; // Time in nanoseconds
time = ((double)nowTime/1000000.0); // Time in miliseconds
#endif
return time;
}