diff options
Diffstat (limited to 'src/ios.m')
-rw-r--r-- | src/ios.m | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -33,11 +33,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
33 | static iBool isSystemDarkMode_ = iFalse; | 33 | static iBool isSystemDarkMode_ = iFalse; |
34 | static iBool isPhone_ = iFalse; | 34 | static iBool isPhone_ = iFalse; |
35 | 35 | ||
36 | static UIViewController *viewController_(iWindow *window) { | 36 | static UIWindow *uiWindow_(iWindow *window) { |
37 | SDL_SysWMinfo wm; | 37 | SDL_SysWMinfo wm; |
38 | SDL_VERSION(&wm.version); | 38 | SDL_VERSION(&wm.version); |
39 | if (SDL_GetWindowWMInfo(window->win, &wm)) { | 39 | if (SDL_GetWindowWMInfo(window->win, &wm)) { |
40 | return wm.info.uikit.window.rootViewController; | 40 | return wm.info.uikit.window; |
41 | } | ||
42 | iAssert(false); | ||
43 | return NULL; | ||
44 | } | ||
45 | |||
46 | static UIViewController *viewController_(iWindow *window) { | ||
47 | UIWindow *uiWin = uiWindow_(window); | ||
48 | if (uiWin) { | ||
49 | return uiWin.rootViewController; | ||
41 | } | 50 | } |
42 | iAssert(false); | 51 | iAssert(false); |
43 | return NULL; | 52 | return NULL; |
@@ -248,6 +257,10 @@ iBool isPhone_iOS(void) { | |||
248 | return isPhone_; | 257 | return isPhone_; |
249 | } | 258 | } |
250 | 259 | ||
260 | int displayRefreshRate_iOS(void) { | ||
261 | return uiWindow_(get_Window()).screen.maximumFramesPerSecond; | ||
262 | } | ||
263 | |||
251 | void setupWindow_iOS(iWindow *window) { | 264 | void setupWindow_iOS(iWindow *window) { |
252 | UIViewController *ctl = viewController_(window); | 265 | UIViewController *ctl = viewController_(window); |
253 | isSystemDarkMode_ = isDarkMode_(window); | 266 | isSystemDarkMode_ = isDarkMode_(window); |