X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_main.c;h=885ed457b818849cc9016c29e2500e84fba0e2b1;hb=42858958aa7357b40e7aa29068054a26c020642e;hp=99040afebaf28ef8001119e9624ed5b918c7807c;hpb=5e0c2363eddcc91af3574ea5777e686e8998e390;p=freeglut diff --git a/src/fg_main.c b/src/fg_main.c index 99040af..885ed45 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; @@ -120,13 +121,17 @@ void fghRedrawWindow ( SFG_Window *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; } INVOKE_WCB( *window, Display, ( ) ); @@ -219,12 +224,8 @@ static void fghCheckTimers( void ) /* Platform-dependent time in milliseconds, as an unsigned 64-bit integer. * This doesn't overflow in any reasonable time, so no need to worry about * that. The GLUT API return value will however overflow after 49.7 days, - * and on Windows we (currently) do not have access to a 64-bit timestamp, - * which means internal time will still get in trouble when running the + * which means you will still get in trouble when running the * application for more than 49.7 days. - * This value wraps every 49.7 days, but integer overflows cancel - * when subtracting an initial start time, unless the total time exceeds - * 32-bit, where the GLUT API return value is also overflowed. */ fg_time_t fgSystemTime(void) { @@ -256,7 +257,7 @@ void fgError( const char *fmt, ... ) va_end( ap ); } else { - +#if FREEGLUT_ERRORS va_start( ap, fmt ); fprintf( stderr, "freeglut "); @@ -266,6 +267,7 @@ void fgError( const char *fmt, ... ) fprintf( stderr, "\n" ); va_end( ap ); +#endif if ( fgState.Initialised ) fgDeinitialize (); @@ -288,7 +290,7 @@ void fgWarning( const char *fmt, ... ) va_end( ap ); } else { - +#if FREEGLUT_WARNINGS va_start( ap, fmt ); fprintf( stderr, "freeglut "); @@ -298,6 +300,7 @@ void fgWarning( const char *fmt, ... ) fprintf( stderr, "\n" ); va_end( ap ); +#endif } }