Make screen_get_refresh_rate() respect iOS Low Power Mode

This commit is contained in:
Zach Coleman 2023-11-17 08:32:54 -05:00
parent 80de898d72
commit 6a8f6bae4c

View file

@ -443,7 +443,11 @@ int DisplayServerIOS::screen_get_dpi(int p_screen) const {
}
float DisplayServerIOS::screen_get_refresh_rate(int p_screen) const {
return [UIScreen mainScreen].maximumFramesPerSecond;
float fps = [UIScreen mainScreen].maximumFramesPerSecond;
if ([NSProcessInfo processInfo].lowPowerModeEnabled) {
fps = 60;
}
return fps;
}
float DisplayServerIOS::screen_get_scale(int p_screen) const {