-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add get_screen_refresh_rate()
to OS
#58812
Add get_screen_refresh_rate()
to OS
#58812
Conversation
773129a
to
dc8facd
Compare
Judging by the screenshot, you should also backport the follow up that limited decimal precision to 2 places. |
dc8facd
to
3d84d6c
Compare
I did, but it doesn't appear to work as expected: https://github.com/godotengine/godot/blob/3d84d6c68294a992ea5b829042ec94414da5c32c/platform/x11/os_x11.cpp#L1368-L1369 It's strange because in GDScript, |
3d84d6c
to
574673e
Compare
574673e
to
362871d
Compare
This method can be used to get the refresh rate of a given screen. It is supported on Windows, macOS, Linux, Android and iOS (but not HTML5).
362871d
to
cec7c90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Android section looks good!
Thanks! |
This method can be used to get the refresh rate of a given screen. It is supported on Windows, macOS, Linux, Android and iOS (but not HTML5).
3.x
version of #57335.I've only tested this on Linux, Windows (via WINE) and Android so far, so testing on other platforms is welcome.
Testing project: test_refresh_rate_3.x.zip
Windows 64-bit export: UnnamedProject-windows.zip
Android export: UnnamedProject-android.zip
Preview