X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=0289ddd693be80415c9bb5b92b69f84dbfbbb4ce;hb=02d1360233aa5a71d0f46fda6c6956c5122fad80;hp=f914bf64b7401f56153b3e0216db8faefc71b811;hpb=98ea79ef777bea593a87aef9600ee3d4fda6e110;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index f914bf6..0289ddd 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -76,6 +76,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ { { 0, 0 }, GL_FALSE }, #endif { NULL, NULL }, /* Timers */ + { NULL, NULL }, /* FreeTimers */ NULL, /* IdleCallback */ 0, /* ActiveMenus */ NULL, /* MenuStateCallback */ @@ -147,7 +148,7 @@ void fgInitialize( const char* displayName ) ATOM atom; /* - * What we need to do is to initialize the fgDisplay global structure here... + * What we need to do is to initialize the fgDisplay global structure here. */ fgDisplay.Instance = GetModuleHandle( NULL ); @@ -157,9 +158,14 @@ void fgInitialize( const char* displayName ) ZeroMemory( &wc, sizeof(WNDCLASS) ); /* - * Each of the windows should have its own device context... + * Each of the windows should have its own device context, and we + * want redraw events during Vertical and Horizontal Resizes by + * the user. + * + * XXX Old code had "| CS_DBCLCKS" commented out. Plans for the + * XXX future? Dead-end idea? */ - wc.style = CS_OWNDC /* | CS_DBLCLKS */; + wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = fgWindowProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; @@ -230,9 +236,15 @@ void fgDeinitialize( void ) fgDestroyStructure( ); - while( timer = ( SFG_Timer * )fgState.Timers.First ) + while( (timer = fgState.Timers.First) ) { - fgListRemove ( &fgState.Timers, &timer->Node ); + fgListRemove( &fgState.Timers, &timer->Node ); + free( timer ); + } + + while( (timer = fgState.FreeTimers.First) ) + { + fgListRemove( &fgState.FreeTimers, &timer->Node ); free( timer ); } @@ -269,7 +281,9 @@ void fgDeinitialize( void ) fgState.Time.Set = GL_FALSE; - fgState.Timers.First = fgState.Timers.Last = NULL; + fgListInit( &fgState.Timers ); + fgListInit( &fgState.FreeTimers ); + fgState.IdleCallback = NULL; fgState.MenuStateCallback = ( FGCBMenuState )NULL; fgState.MenuStatusCallback = ( FGCBMenuStatus )NULL;