Merge pull request #1834 from ricpelo/ricpelo-patch-6

Better OS X fullscreen support, without the nasty startup effect
This commit is contained in:
punto- 2015-05-06 09:32:17 -03:00
commit 83fe66d968
1 changed files with 10 additions and 3 deletions

View File

@ -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;