diff options
author | Ricardo Pérez <ricpelo@gmail.com> | 2015-05-06 12:53:55 +0200 |
---|---|---|
committer | Ricardo Pérez <ricpelo@gmail.com> | 2015-05-06 12:53:55 +0200 |
commit | 979b931995df4c7da80702ce9652862267b1023d (patch) | |
tree | 05269021829373a8063acebf145ea7fd7d382cb1 | |
parent | 1ae03fd39d9c2dd483f770f88ccae0ddcf2b66b5 (diff) |
Better OS X fullscreen support, without the nasty startup effect
-rw-r--r-- | platform/osx/os_osx.mm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 03e643db6f..eb2a12cdef 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -969,7 +969,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi [window_object makeKeyAndOrderFront:nil]; if (p_desired.fullscreen) - set_window_fullscreen(true); + zoomed = true; /*** END OSX INITIALIZATION ***/ /*** END OSX INITIALIZATION ***/ @@ -1312,11 +1312,13 @@ void OS_OSX::set_window_size(const Size2 p_size) { void OS_OSX::set_window_fullscreen(bool p_enabled) { + if (zoomed != p_enabled) { #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - [window_object toggleFullScreen:nil]; + [window_object toggleFullScreen:nil]; #else - [window_object performZoom:nil]; + [window_object performZoom:nil]; #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ + } zoomed = p_enabled; }; @@ -1517,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; |