* the already-drawn part does not get drawn again and things look funny.
* But without this we get this bad behaviour whenever we resize the
* window.
+ * DN: Hmm.. the above sounds like a concern only in single buffered mode...
*/
window->State.Redisplay = GL_TRUE;
void fghRedrawWindow ( SFG_Window *window )
{
SFG_Window *current_window = fgStructure.CurrentWindow;
+ printf("fghRedrawWindow\n");
freeglut_return_if_fail( window );
+ printf("got window\n");
if( window->State.NeedToInitContext ) {
INVOKE_WCB( *window, InitContext, ());
}
freeglut_return_if_fail( FETCH_WCB ( *window, Display ) );
+ printf("got displayCB\n");
window->State.Redisplay = GL_FALSE;
freeglut_return_if_fail( window->State.Visible );
+ printf("we're visible\n");
fgSetWindow( window );
if( window->State.NeedToResize )
{
+ /* Set need to resize to false before calling fghReshapeWindow, otherwise
+ in the case the user's reshape callback calls glutReshapeWindow,
+ his request would get canceled after fghReshapeWindow gets called.
+ */
+ window->State.NeedToResize = GL_FALSE;
+
fghReshapeWindow(
window,
window->State.Width,
window->State.Height
);
-
- window->State.NeedToResize = GL_FALSE;
}
+ printf("invoking displayCB\n");
INVOKE_WCB( *window, Display, ( ) );
fgSetWindow( current_window );
static void fghcbDisplayWindow( SFG_Window *window,
SFG_Enumerator *enumerator )
{
+ printf("window %p, %i\n",window,window->State.Redisplay);
if( window->State.Redisplay &&
window->State.Visible )
{
window->State.Redisplay = GL_FALSE;
+ printf("redisplaying...\n");
fgPlatformDisplayWindow ( window );
}