added cursor changing to resizer demo, for testing
[freeglut] / src / fg_structure.c
index be9d1ce..2a65b69 100644 (file)
@@ -113,7 +113,6 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
  */
 SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
 {
-    int x = 100, y = 100, w = 1, h = 1;
     SFG_Window *current_window = fgStructure.CurrentWindow;
 
     /* Have the menu object created */
@@ -122,19 +121,18 @@ SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
     menu->ParentWindow = NULL;
 
     /* Create a window for the menu to reside in. */
-
-    fgCreateWindow( NULL, "freeglut menu", GL_TRUE, x, y, GL_TRUE, w, h,
+    fgCreateWindow( NULL, "freeglut menu", GL_FALSE, 0, 0, GL_FALSE, 0, 0,
                     GL_FALSE, GL_TRUE );
     menu->Window = fgStructure.CurrentWindow;
     glutDisplayFunc( fgDisplayMenu );
 
-    glutHideWindow( );  /* Hide the window for now */
     fgSetWindow( current_window );
 
     /* Initialize the object properties: */
     menu->ID       = ++fgStructure.MenuID;
     menu->Callback = menuCallback;
     menu->ActiveEntry = NULL;
+    menu->Font     = fgState.MenuFont;
 
     fgListInit( &menu->Entries );
     fgListAppend( &fgStructure.Menus, &menu->Node );
@@ -533,7 +531,7 @@ static void fghcbMenuByID( SFG_Menu *menu,
         return;
 
     /* Check the menu's ID. */
-    if( menu->ID == (int)(enumerator->data) )
+    if( menu->ID == *( int *)(enumerator->data) )
     {
         enumerator->found = GL_TRUE;
         enumerator->data = menu;
@@ -552,7 +550,7 @@ SFG_Menu* fgMenuByID( int menuID )
 
     /* This is easy and makes use of the menus enumeration defined above */
     enumerator.found = GL_FALSE;
-    enumerator.data = (void *)menuID;
+    enumerator.data = (void *)&menuID;
     fgEnumMenus( fghcbMenuByID, &enumerator );
 
     if( enumerator.found )