mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
Convert ticks to 64-bit, added nanosecond precision to the API
Fixes https://github.com/libsdl-org/SDL/issues/5512 Fixes https://github.com/libsdl-org/SDL/issues/6731
This commit is contained in:
parent
764b899a13
commit
8121bbd083
96 changed files with 938 additions and 1243 deletions
|
@ -92,7 +92,7 @@ static struct
|
|||
SDL_bool m_bInitialized;
|
||||
Uint32 m_unDeviceChangeCounter;
|
||||
SDL_bool m_bCanGetNotifications;
|
||||
Uint32 m_unLastDetect;
|
||||
Uint64 m_unLastDetect;
|
||||
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
SDL_threadID m_nThreadID;
|
||||
|
@ -367,8 +367,8 @@ HIDAPI_UpdateDiscovery()
|
|||
|
||||
if (!SDL_HIDAPI_discovery.m_bCanGetNotifications) {
|
||||
const Uint32 SDL_HIDAPI_DETECT_INTERVAL_MS = 3000; /* Update every 3 seconds */
|
||||
Uint32 now = SDL_GetTicks();
|
||||
if (!SDL_HIDAPI_discovery.m_unLastDetect || SDL_TICKS_PASSED(now, SDL_HIDAPI_discovery.m_unLastDetect + SDL_HIDAPI_DETECT_INTERVAL_MS)) {
|
||||
Uint64 now = SDL_GetTicks();
|
||||
if (!SDL_HIDAPI_discovery.m_unLastDetect || now >= (SDL_HIDAPI_discovery.m_unLastDetect + SDL_HIDAPI_DETECT_INTERVAL_MS)) {
|
||||
++SDL_HIDAPI_discovery.m_unDeviceChangeCounter;
|
||||
SDL_HIDAPI_discovery.m_unLastDetect = now;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue