1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add screen_get_refresh_rate to DisplayServer

This commit is contained in:
jordi
2022-01-27 13:46:57 -06:00
parent 203e261526
commit 54dec44dba
19 changed files with 172 additions and 0 deletions

View File

@@ -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();