* Based on NSOpenGLView and Apple's GLEssentials sample code
* CVDisplayLink- or NSTimer-driven rendering
* Works in window or fullscreen mode on Mac OSX Lion or later
TODO FIXME:
* Breaks Linux/Posix build
* Cocoa menu interfaces
* Key/mouse/joystick/gamepad handling
* GLUT sends the raw ascii ctrl-values, so we merely send them along in a "cooked" mode
+ It may be that some strange ctrl combinations (saw CTRL-~ or CTRL-ESC) are not properly handled this way, but
... not sure what can be done about this (doesn't seem to be a way to force glut to send us the non-cooked keys)
* Legacy X11 input continues to be sent as raw values (which arguably is a better way)
* TIL GLUT constants for certain special keys map to ascii (for example GLUT_KEY_ALT_L == 116/'t') ... of course
this was playing hell with the emulator's key input handling
* Now we directly convert regular keys rather than pushing them down the special path
* Also separateds CAPS_LOCK hack into its own inline function
* Added an option to set caps lock (basing it off X11's value is not working well)
* Added a reboot emulator option (because Ctrl-Alt-End is potentially mapped by the X11 WM. ahem, Xfce...