I've downloaded the LWJGL source and made a small change to MacOSXDisplay.java. I check if the context is current before attempting to call openGL commands. Not quite sure if my fix is everything it should be.
Some feedback? Thanks :-)
public void update() {
boolean should_update = true;
DrawableGL drawable = (DrawableGL)Display.getDrawable();
if (should_update) {
drawable.context.update();
try{
if( drawable.context.isCurrent())
{
/* This is necessary to make sure the context won't "forget" about the view size */
if (skipViewportValue) skipViewportValue = false;
else glGetInteger(GL_VIEWPORT, current_viewport);
glViewport(current_viewport.get(0), current_viewport.get(1), current_viewport.get(2), current_viewport.get(3));
}
} catch (Exception e){}
}
if (native_mode && updateNativeCursor) {
updateNativeCursor = false;
try {
setNativeCursor(currentNativeCursor);
} catch (LWJGLException e) {
e.printStackTrace();
}
}
}