SDL 2.0 on Mac - how to activate / respond to greyed-out Toggle Full Screen menu item?

Working on porting a Windows game to a Mac using SDL2, and I noticed on a Mac that there is a View menu with a Toggle Full Screen item in the menu bar for the game. My guess is that SDL puts it in there automatically, since I didn't ask for it anywhere in my code. However, since the game can run in a window or full screen (and the window resizes), I suppose I should make this menu item actually work somehow.

I know almost nothing about coding Mac OSX (I just followed a tutorial to get an SDL app for Mac side build in XCode) and I cannot find anything in the SDL documentation on how to react, activate, or remove that menu item (or others that are grayed out, such as the Minimize option in the Window menu). The best I can find on the internet is a link to add it to the SDL database commit, but nothing in the commit message on how to connect it to your application code.

So how do I activate and respond to this menu item (and any other menu items that only appear in OSX builds, like Minimize and About)? And is it that I can connect in a cross-platform way via SDL or SDL add something I need to use OSX code on the platform?

+3


source to share





All Articles