summaryrefslogtreecommitdiff
path: root/platform/iphone
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-04 11:51:07 +0100
committerGitHub <noreply@github.com>2022-02-04 11:51:07 +0100
commitd235c1bb1964b80d776a64aa2a1b198a8e52bf72 (patch)
tree5580b3e38c269efb494b20d54ae6a3e355d2dd58 /platform/iphone
parent85f6151e9d4ce9ecc4fe587cc6e76356b49e8a43 (diff)
parent54dec44dbae4859842c6d99aafaafd186b33fee4 (diff)
Merge pull request #57335 from jordigcs/display-refresh-rate
Diffstat (limited to 'platform/iphone')
-rw-r--r--platform/iphone/display_server_iphone.h1
-rw-r--r--platform/iphone/display_server_iphone.mm4
2 files changed, 5 insertions, 0 deletions
diff --git a/platform/iphone/display_server_iphone.h b/platform/iphone/display_server_iphone.h
index 6434483641..7441550f67 100644
--- a/platform/iphone/display_server_iphone.h
+++ b/platform/iphone/display_server_iphone.h
@@ -129,6 +129,7 @@ public:
virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
+ virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
virtual Vector<DisplayServer::WindowID> get_window_list() const override;
diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm
index 48bda89fc3..9491c9cf90 100644
--- a/platform/iphone/display_server_iphone.mm
+++ b/platform/iphone/display_server_iphone.mm
@@ -393,6 +393,10 @@ int DisplayServerIPhone::screen_get_dpi(int p_screen) const {
}
}
+float DisplayServerIPhone::screen_get_refresh_rate(int p_screen) const {
+ return [UIScreen mainScreen].maximumFramesPerSecond;
+}
+
float DisplayServerIPhone::screen_get_scale(int p_screen) const {
return [UIScreen mainScreen].nativeScale;
}