projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added missing prototype for new list function.
[freeglut]
/
src
/
freeglut_init.c
diff --git
a/src/freeglut_init.c
b/src/freeglut_init.c
index
f914bf6
..
0289ddd
100644
(file)
--- 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 */
{ { 0, 0 }, GL_FALSE },
#endif
{ NULL, NULL }, /* Timers */
+ { NULL, NULL }, /* FreeTimers */
NULL, /* IdleCallback */
0, /* ActiveMenus */
NULL, /* MenuStateCallback */
NULL, /* IdleCallback */
0, /* ActiveMenus */
NULL, /* MenuStateCallback */
@@
-147,7
+148,7
@@
void fgInitialize( const char* displayName )
ATOM atom;
/*
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 );
*/
fgDisplay.Instance = GetModuleHandle( NULL );
@@
-157,9
+158,14
@@
void fgInitialize( const char* displayName )
ZeroMemory( &wc, sizeof(WNDCLASS) );
/*
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;
wc.lpfnWndProc = fgWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
@@
-230,9
+236,15
@@
void fgDeinitialize( void )
fgDestroyStructure( );
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 );
}
free( timer );
}
@@
-269,7
+281,9
@@
void fgDeinitialize( void )
fgState.Time.Set = GL_FALSE;
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;
fgState.IdleCallback = NULL;
fgState.MenuStateCallback = ( FGCBMenuState )NULL;
fgState.MenuStatusCallback = ( FGCBMenuStatus )NULL;