How to toggle screen to fullscreen or windowed in Mac OS X?

Hi there,
How to implement toggle of screen size among windowed or fullscreen mode in Mac OS platform? Changing should be made in runtime.

I’m wondering the same thing, Petro. Have you found an answer?

This works, but isn’t really great:

Basically, if I launch the game in Windowed mode with
glview = GLViewImpl::create(“Psf2016”);
then I get the little controls in the upper left, but not the green one, so I’m unable to switch to full screen.

So, to get around that, I have an in-game switch, where the user selects “full screen” and then restarts the game. I think use a different call
glview = GLViewImpl::createWithFullScreen(“Psf2016”);

On the good side, this does put the game in full screen, but now it covers everything, including the bottom controls on the desktop, and doesn’t have the little red/yellow/green buttons (or even a menu bar at all).

Any suggestions?

I haven’t found an answer yet.
Does your users restarts game manually or game restarts itself?

manually, but last night I tried cocos2d-x version 3.13, and it greatly improves full screen on Mac! Check out the thread at Still have issue with Mac full screen and controls