* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <GL/freeglut.h>
#include "freeglut_internal.h"
-
/* -- GLOBAL EXPORTS ------------------------------------------------------- */
/*
* dependant, and resides in freeglut_window.c. Uses fgState.
*/
fgOpenWindow( window, title, x, y, w, h, gameMode,
- parent ? GL_TRUE : GL_FALSE );
+ (GLboolean)(parent ? GL_TRUE : GL_FALSE) );
return window;
}
/* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
- menu->ParentWindow = fgStructure.Window;
+ menu->ParentWindow = NULL;
/* Create a window for the menu to reside in. */
*/
void fgDestroyWindow( SFG_Window* window )
{
- int menu_index;
-
FREEGLUT_INTERNAL_ERROR_EXIT ( window, "Window destroy function called with null window",
"fgDestroyWindow" );
if( window->ActiveMenu )
fgDeactivateMenu( window );
- for( menu_index = 0; menu_index < 3; menu_index ++ )
- if( window->Menu[ menu_index ] )
- window->Menu[ menu_index ]->ParentWindow = NULL;
-
fghClearCallBacks( window );
fgCloseWindow( window );
free( window );
SFG_Window *subWindow;
int i;
+ /* Check whether this is the active menu in the window */
+ if ( menu == window->ActiveMenu )
+ window->ActiveMenu = NULL ;
+
/*
* Check if the menu is attached to the current window,
* if so, have it detached (by overwriting with a NULL):
}
if( fgStructure.Window == menu->Window )
- fgSetWindow( menu->ParentWindow );
+ fgSetWindow( NULL );
fgDestroyWindow( menu->Window );
fgListRemove( &fgStructure.Menus, &menu->Node );
if( fgStructure.Menu == menu )