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

floating point Refresh Rate not reported correctly #10185

Closed
TylerGlaiel opened this issue Jul 5, 2024 · 6 comments · Fixed by #10247
Closed

floating point Refresh Rate not reported correctly #10185

TylerGlaiel opened this issue Jul 5, 2024 · 6 comments · Fixed by #10247
Milestone

Comments

@TylerGlaiel
Copy link

Windows says my monitor is 143.963hz
SDL reports this as 144.0hz

@slouken
Copy link
Collaborator

slouken commented Jul 5, 2024

Can you debug it and find out why?

@TylerGlaiel
Copy link
Author

TylerGlaiel commented Jul 5, 2024

image
something to do with windows maybe, or the comment that suggests theres a better way to query it

@TylerGlaiel
Copy link
Author

TylerGlaiel commented Jul 7, 2024

I can confirm that using DXGI instead reports the correct framerate

@slouken
Copy link
Collaborator

slouken commented Jul 13, 2024

Fixed!

@TylerGlaiel
Copy link
Author

TylerGlaiel commented Jul 13, 2024

image
theres still a little bit of weird rounding here (float refresh rate is 143.960, but actual refresh rate (numerator / denominator) is 143.963

windows shows 3 digits of precision for this
image

@slouken
Copy link
Collaborator

slouken commented Jul 13, 2024

The floating point value has 2 digits of precision for display purposes. If you want the full precision, you should use the numerator and denominator to calculate it.

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 a pull request may close this issue.

2 participants