Pass the event timestamp for joystick events

This allows the application to get more fine grained information about controller event timing, and group events that happened together.
This commit is contained in:
Sam Lantinga
2022-12-03 11:15:50 -08:00
parent f32cdfa096
commit 73f4aeee6a
36 changed files with 950 additions and 839 deletions

View File

@@ -538,6 +538,16 @@ void SDL_TicksQuit(void)
tick_start = 0;
}
Uint64
SDL_GetTickStartNS(void)
{
if (!tick_start) {
SDL_TicksInit();
}
return (tick_start * SDL_NS_PER_SECOND) / tick_freq;
}
Uint64
SDL_GetTicksNS(void)
{

View File

@@ -33,6 +33,7 @@ extern void SDL_TicksInit(void);
extern void SDL_TicksQuit(void);
extern int SDL_TimerInit(void);
extern void SDL_TimerQuit(void);
extern Uint64 SDL_GetTickStartNS(void);
#endif /* SDL_timer_c_h_ */