From ddda7ab09f5a3f1485c419443fe240651a53b457 Mon Sep 17 00:00:00 2001 From: fayjf Date: Fri, 22 Apr 2005 18:18:29 +0000 Subject: [PATCH] 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 --- freeglut/freeglut/src/freeglut_structure.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/freeglut_structure.c b/freeglut/freeglut/src/freeglut_structure.c index 03c1a8f..d3f9f05 100644 --- a/freeglut/freeglut/src/freeglut_structure.c +++ b/freeglut/freeglut/src/freeglut_structure.c @@ -236,7 +236,7 @@ static void fghRemoveMenuFromWindow( SFG_Window* window, SFG_Menu* menu ) * Check if the menu is attached to the current window, * 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 ) window->Menu[ i ] = NULL; @@ -342,6 +342,13 @@ void fgCreateStructure( void ) fgListInit(&fgStructure.Windows); fgListInit(&fgStructure.Menus); fgListInit(&fgStructure.WindowsToDestroy); + + fgStructure.CurrentWindow = NULL; + fgStructure.CurrentMenu = NULL; + fgStructure.MenuContext = NULL; + fgStructure.GameMode = NULL; + fgStructure.WindowID = 0; + fgStructure.MenuID = 0; } /*