Change a hard-coded number to a defined constant and add some initializations

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@577 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2005-04-22 18:18:29 +00:00
parent 401e4369e5
commit ddda7ab09f

View File

@ -236,7 +236,7 @@ static void fghRemoveMenuFromWindow( SFG_Window* window, SFG_Menu* menu )
* Check if the menu is attached to the current window, * Check if the menu is attached to the current window,
* if so, have it detached (by overwriting with a NULL): * if so, have it detached (by overwriting with a NULL):
*/ */
for( i = 0; i < 3; i++ ) for( i = 0; i < FREEGLUT_MAX_MENUS; i++ )
if( window->Menu[ i ] == menu ) if( window->Menu[ i ] == menu )
window->Menu[ i ] = NULL; window->Menu[ i ] = NULL;
@ -342,6 +342,13 @@ void fgCreateStructure( void )
fgListInit(&fgStructure.Windows); fgListInit(&fgStructure.Windows);
fgListInit(&fgStructure.Menus); fgListInit(&fgStructure.Menus);
fgListInit(&fgStructure.WindowsToDestroy); fgListInit(&fgStructure.WindowsToDestroy);
fgStructure.CurrentWindow = NULL;
fgStructure.CurrentMenu = NULL;
fgStructure.MenuContext = NULL;
fgStructure.GameMode = NULL;
fgStructure.WindowID = 0;
fgStructure.MenuID = 0;
} }
/* /*