if( event.xexpose.count == 0 )
{
GETWINDOW( xexpose );
- window->State.Redisplay = GL_TRUE;
+ window->State.WorkMask |= GLUT_DISPLAY_WORK;
}
break;
/* Now clear it so that any callback generated by the actions below can set work again */
window->State.WorkMask = 0;
+ if (workMask&~GLUT_DISPLAY_WORK) /* Display work is the common case, skip all the below at once */
+ {
/* This is before the first display callback: call a few callbacks to inform user of window size, position, etc
* we know this is before the first display callback of a window as for all windows GLUT_INIT_WORK is set when
* they are opened, and work is done before displaying in the mainloop.
break;
}
}
+ }
+
+ if (workMask & GLUT_DISPLAY_WORK)
+ {
+ if( window->State.Visible )
+ fghRedrawWindow ( window );
+
+ /* Strip out display work that might have ended up on work list now as some of the above genereates callbacks */
+ window->State.WorkMask &= ~GLUT_DISPLAY_WORK;
+ }
}