diff options
author | Juan Linietsky <red@kyoko> | 2015-05-11 15:49:41 -0300 |
---|---|---|
committer | Juan Linietsky <red@kyoko> | 2015-05-11 15:49:41 -0300 |
commit | 4b8745ad63409cf14b02735981ee35d2f794421c (patch) | |
tree | 607dcfbb77430e8ed7eef25de6b7bec9c4032aec /platform/osx | |
parent | dda60296d81edaabfdb56f47a2c949b5dad283fb (diff) | |
parent | b777bf5ff5c3891daa0f93987ca12d0d7d053c2b (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/os_osx.mm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index dd19dbbff6..eb2a12cdef 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -966,8 +966,10 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi [NSApp activateIgnoringOtherApps:YES]; - [window_object makeKeyAndOrderFront:nil]; + [window_object makeKeyAndOrderFront:nil]; + if (p_desired.fullscreen) + zoomed = true; /*** END OSX INITIALIZATION ***/ /*** END OSX INITIALIZATION ***/ @@ -1310,14 +1312,22 @@ void OS_OSX::set_window_size(const Size2 p_size) { void OS_OSX::set_window_fullscreen(bool p_enabled) { - [window_object performZoom:nil]; + if (zoomed != p_enabled) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 + [window_object toggleFullScreen:nil]; +#else + [window_object performZoom:nil]; +#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ + } zoomed = p_enabled; }; bool OS_OSX::is_window_fullscreen() const { +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 if ( [window_object respondsToSelector:@selector(isZoomed)] ) return [window_object isZoomed]; +#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ return zoomed; }; @@ -1509,6 +1519,11 @@ void OS_OSX::run() { main_loop->init(); + if (zoomed) { + zoomed = false; + set_window_fullscreen(true); + } + // uint64_t last_ticks=get_ticks_usec(); // int frames=0; |