Merge pull request #1834 from ricpelo/ricpelo-patch-6
Better OS X fullscreen support, without the nasty startup effect
This commit is contained in:
commit
83fe66d968
|
@ -969,7 +969,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
|
||||||
[window_object makeKeyAndOrderFront:nil];
|
[window_object makeKeyAndOrderFront:nil];
|
||||||
|
|
||||||
if (p_desired.fullscreen)
|
if (p_desired.fullscreen)
|
||||||
set_window_fullscreen(true);
|
zoomed = true;
|
||||||
|
|
||||||
/*** END OSX INITIALIZATION ***/
|
/*** END OSX INITIALIZATION ***/
|
||||||
/*** 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) {
|
void OS_OSX::set_window_fullscreen(bool p_enabled) {
|
||||||
|
|
||||||
|
if (zoomed != p_enabled) {
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||||
[window_object toggleFullScreen:nil];
|
[window_object toggleFullScreen:nil];
|
||||||
#else
|
#else
|
||||||
[window_object performZoom:nil];
|
[window_object performZoom:nil];
|
||||||
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
|
||||||
|
}
|
||||||
zoomed = p_enabled;
|
zoomed = p_enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1517,6 +1519,11 @@ void OS_OSX::run() {
|
||||||
|
|
||||||
main_loop->init();
|
main_loop->init();
|
||||||
|
|
||||||
|
if (zoomed) {
|
||||||
|
zoomed = false;
|
||||||
|
set_window_fullscreen(true);
|
||||||
|
}
|
||||||
|
|
||||||
// uint64_t last_ticks=get_ticks_usec();
|
// uint64_t last_ticks=get_ticks_usec();
|
||||||
|
|
||||||
// int frames=0;
|
// int frames=0;
|
||||||
|
|
Loading…
Reference in New Issue