Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_GetTicks64 consistency in SDL_Event timestamp #5512

Closed
fhoenig opened this issue Apr 11, 2022 · 3 comments
Closed

SDL_GetTicks64 consistency in SDL_Event timestamp #5512

fhoenig opened this issue Apr 11, 2022 · 3 comments
Assignees
Milestone

Comments

@fhoenig
Copy link

fhoenig commented Apr 11, 2022

The documentation recommends to use SDL_GetTicks64 instead of SDL_GetTicks. However the event timestamps are still 32-bit unsigned int.

@icculus icculus self-assigned this Apr 11, 2022
@icculus
Copy link
Collaborator

icculus commented Apr 11, 2022

We can't change this in SDL2 because extending the event structs would break ABI.

@icculus icculus added this to the 3.0 milestone Apr 11, 2022
@vitiral
Copy link

vitiral commented Nov 10, 2022

Okay, then can the recommendation be changed to use SDL_GetTicks32? It would be pretty dangerous I think to deal with both. The game would have to stay running for several days, which would make the bug even harder to detect.

@slouken
Copy link
Collaborator

slouken commented Dec 2, 2022

The event structure now uses a 64-bit timestamp and the timestamps are in nanoseconds, relative to the new SDL_GetTicksNS() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants