mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-16 08:18:13 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
@@ -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_ */
|
||||
|
||||
|
Reference in New Issue
Block a user