strip out GLUT_DISPLAY_CALLBACK from worklist _before_ calling display callback. Any postredisplay in the display callback will then be honored, but no unnecessary redisplay work will be called due to redisplays queued during resize, visibility and other such processing
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1617 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
42dc7ef4bf
commit
6e7e3375a3
@ -432,12 +432,19 @@ void fgPlatformProcessWork(SFG_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
if (workMask & GLUT_DISPLAY_WORK)
|
||||
/* check window state's workmask as well as some of the above callbacks might have generated redisplay requests. We can deal with those right now instead of wait for the next mainloop iteration. */
|
||||
if (workMask & GLUT_DISPLAY_WORK || window->State.WorkMask & GLUT_DISPLAY_WORK)
|
||||
{
|
||||
if( window->State.Visible )
|
||||
{
|
||||
/* Strip out display work from the work list */
|
||||
/* NB: do this before the display callback is called as user might call postredisplay in his display callback */
|
||||
window->State.WorkMask &= ~GLUT_DISPLAY_WORK;
|
||||
|
||||
fghRedrawWindow ( window );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user