summaryrefslogtreecommitdiff
path: root/src/ios.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/ios.m')
-rw-r--r--src/ios.m17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ios.m b/src/ios.m
index 9aca5a19..58557ef5 100644
--- a/src/ios.m
+++ b/src/ios.m
@@ -33,11 +33,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
33static iBool isSystemDarkMode_ = iFalse; 33static iBool isSystemDarkMode_ = iFalse;
34static iBool isPhone_ = iFalse; 34static iBool isPhone_ = iFalse;
35 35
36static UIViewController *viewController_(iWindow *window) { 36static 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
46static 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
260int displayRefreshRate_iOS(void) {
261 return uiWindow_(get_Window()).screen.maximumFramesPerSecond;
262}
263
251void setupWindow_iOS(iWindow *window) { 264void setupWindow_iOS(iWindow *window) {
252 UIViewController *ctl = viewController_(window); 265 UIViewController *ctl = viewController_(window);
253 isSystemDarkMode_ = isDarkMode_(window); 266 isSystemDarkMode_ = isDarkMode_(window);