X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_main.c;h=b664fa3ebc15b7b6949c56b75ada0c7794dcb967;hb=b23128a3f3779555ea461278346d628a9b49fad0;hp=99040afebaf28ef8001119e9624ed5b918c7807c;hpb=5e0c2363eddcc91af3574ea5777e686e8998e390;p=freeglut diff --git a/src/fg_main.c b/src/fg_main.c index 99040af..b664fa3 100644 --- a/src/fg_main.c +++ b/src/fg_main.c @@ -88,6 +88,7 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height ) * 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; @@ -102,8 +103,10 @@ static void fghReshapeWindow ( SFG_Window *window, int width, int height ) 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, ()); @@ -111,24 +114,31 @@ void fghRedrawWindow ( SFG_Window *window ) } 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 ); @@ -138,10 +148,12 @@ void fghRedrawWindow ( SFG_Window *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 ); }