From 54dec44dbae4859842c6d99aafaafd186b33fee4 Mon Sep 17 00:00:00 2001 From: jordi Date: Thu, 27 Jan 2022 13:46:57 -0600 Subject: Add screen_get_refresh_rate to DisplayServer --- platform/iphone/display_server_iphone.h | 1 + platform/iphone/display_server_iphone.mm | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'platform/iphone') diff --git a/platform/iphone/display_server_iphone.h b/platform/iphone/display_server_iphone.h index de04bc88e3..1bd5f8737b 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 get_window_list() const override; diff --git a/platform/iphone/display_server_iphone.mm b/platform/iphone/display_server_iphone.mm index 77e1a6078c..2b4098988c 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; } -- cgit v1.2.3