From 1ac074e1a4507135f6ddf628b8531356cacbfb0e Mon Sep 17 00:00:00 2001 From: "John F. Fay" 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@577 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_structure.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index 03c1a8f..d3f9f05 100644 --- a/src/freeglut_structure.c +++ b/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; } /* -- 1.7.10.4