diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-04 11:51:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 11:51:07 +0100 |
commit | d235c1bb1964b80d776a64aa2a1b198a8e52bf72 (patch) | |
tree | 5580b3e38c269efb494b20d54ae6a3e355d2dd58 /platform/android/display_server_android.cpp | |
parent | 85f6151e9d4ce9ecc4fe587cc6e76356b49e8a43 (diff) | |
parent | 54dec44dbae4859842c6d99aafaafd186b33fee4 (diff) |
Merge pull request #57335 from jordigcs/display-refresh-rate
Diffstat (limited to 'platform/android/display_server_android.cpp')
-rw-r--r-- | platform/android/display_server_android.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index 3d0dabc56e..b0f16337ed 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -161,6 +161,16 @@ int DisplayServerAndroid::screen_get_dpi(int p_screen) const { return godot_io_java->get_screen_dpi(); } +float DisplayServerAndroid::screen_get_refresh_rate(int p_screen) const { + GodotIOJavaWrapper *godot_io_java = OS_Android::get_singleton()->get_godot_io_java(); + if (!godot_io_java) { + ERR_PRINT("An error occured while trying to get the screen refresh rate."); + return SCREEN_REFRESH_RATE_FALLBACK; + } + + return godot_io_java->get_screen_refresh_rate(SCREEN_REFRESH_RATE_FALLBACK); +} + bool DisplayServerAndroid::screen_is_touchscreen(int p_screen) const { return true; } |