Add support for floating point main callback rates #13307
Merged
+8
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toUint64
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.