Skip to content

Add support for floating point main callback rates #13307

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

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

nightmareci
Copy link
Contributor

A use case where supporting floating point callback rates is useful is when setting the callback rate to the display's refresh rate, which isn't always an exact integer. So, I've added such support to the callback rate hint.

The change of callback_rate_increment's type to Uint64 is actually necessary now, because a nonzero less-than-one callback rate results in the increment being multiple seconds, so it's best to have as much room as possible for the increment in such a use case.

As SDL_atof() parses integer strings as expected, this PR doesn't introduce ABI breakage.

@icculus icculus merged commit 380b6a4 into libsdl-org:main Jul 1, 2025
41 checks passed
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

Successfully merging this pull request may close these issues.

2 participants