diff options
author | jordi <creptthrust@gmail.com> | 2022-01-27 13:46:57 -0600 |
---|---|---|
committer | jordi <creptthrust@gmail.com> | 2022-02-03 21:50:32 -0600 |
commit | 54dec44dbae4859842c6d99aafaafd186b33fee4 (patch) | |
tree | 404270d60c2baaba7031df98bb78c604872e30a3 /platform/android/java/lib | |
parent | 203e261526ebe123523d7e6ea6cfc6c628216e9d (diff) |
Add screen_get_refresh_rate to DisplayServer
Diffstat (limited to 'platform/android/java/lib')
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/GodotIO.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java index d679fd92c0..b151e7eec1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java @@ -226,6 +226,14 @@ public class GodotIO { return (int)(metrics.density * 160f); } + public double getScreenRefreshRate(double fallback) { + Display display = activity.getWindowManager().getDefaultDisplay(); + if (display != null) { + return display.getRefreshRate(); + } + return fallback; + } + public int[] screenGetUsableRect() { DisplayMetrics metrics = activity.getResources().getDisplayMetrics(); Display display = activity.getWindowManager().getDefaultDisplay(); |