is there any particular reason why there is OS X specific code in the gears demo? commented it out and still works fine on OS X, is it needed?
You'll find that it will crash if you try to resize the window, because the AppKit thread "hijacks" the context. That's why you need locking, two threads may be accessing the context at the same time. Another drawback is that the windowRefresh callback is basically useless with the current implementation. Normally it's called during resize, so that you can redraw your app and avoid flicker. With the current event queuing scheme it's too late by the time the refresh event is received.
This is all the unfortunate consequence of how OS X works and how GLFW was (logically) designed. LWJGL can probably offer two modes:
- Use XstartOnFirstThread, use GLFW just like it was meant to (everything on the first/main thread), never touch AWT.
- Current scheme, with the drawbacks/gotchas mentioned.
Anything else would probably require a custom implementation or hacking GLFW.