I'm porting my OpenTK-based game from Linux to the Mac (with surprisingly few difficulties!) and have a quick question on how to properly launch my "sub-games". My main application is built in GTK# and houses some common setup routines for all the sub-games. When the user has everything set up, they select a game from the list, click Play, and the program runs the corresponding .NET executable with the appropriate command-line arguments (using Process.Run). All sub-games are just regular GameWindow.Run() applications that use OpenGL.
This works perfectly on Linux, but has some strange behavior on the Mac. If the game is set to be full-screen, it works just fine. If not, though, the game is displayed and runs properly, but the game window cannot receive any input (keyboard/mouse/focus); it just sits behind other windows and ignores me! The same thing happens if I launch the game executable directly from the Mac terminal ("mono game.exe ..."). Once again, setting full-screen remedies the problem (unfortunately, windowed-mode is one of my user requirements).
Here are the things I've tried to remedy this:
- Repackage the game executables as Mac app bundles - this solves my windowed-mode problem, but I can't pass in command-line arguments anymore (thank you, Apple) via Process.Run
- Reference the game executables in the main GTK# program and invoke the game's Main method directly like the OpenTK examples launcher - works beautifully, but crashes the main program immediately when the game exits regardless of whether it is launched in a try/catch block, in its own thread, or even in its own AppDomain (this appears to be an issue in GTK# from what I can gather in the stacktrace)
If anyone has some advice, it would be much appreciated!