+ SFG_MenuEntry *menuEntry;
+ int i;
+
+ /*
+ * Have the menu box drawn first. The +- values are
+ * here just to make it more nice-looking...
+ */
+ glColor4f( 0.0f, 0.0f, 0.0f, 1.0f );
+ glBegin( GL_QUADS );
+ glVertex2i( menu->X , menu->Y - 1 );
+ glVertex2i( menu->X + menu->Width, menu->Y - 1 );
+ glVertex2i( menu->X + menu->Width, menu->Y + 4 + menu->Height );
+ glVertex2i( menu->X , menu->Y + 4 + menu->Height );
+ glEnd();
+
+ glColor4f( 0.3f, 0.4f, 0.5f, 1.0f );
+ glBegin( GL_QUADS );
+ glVertex2i( menu->X - 2 , menu->Y + 1 );
+ glVertex2i( menu->X - 2 + menu->Width, menu->Y + 1 );
+ glVertex2i( menu->X - 2 + menu->Width, menu->Y + 2 + menu->Height );
+ glVertex2i( menu->X - 2 , menu->Y + 2 + menu->Height );
+ glEnd();
+
+ /*
+ * Check if any of the submenus is currently active...
+ */
+ for( menuEntry = menu->Entries.First; menuEntry;
+ menuEntry = menuEntry->Node.Next )
+ {
+ /*
+ * Has the menu been marked as active, maybe?
+ */
+ if( menuEntry->IsActive == TRUE )
+ {
+ /*
+ * That's truly right, and we need to have it highlighted.
+ * There is an assumption that mouse cursor didn't move
+ * since the last check of menu activity state:
+ */
+ int menuID = menuEntry->Ordinal;
+
+ /*
+ * So have the highlight drawn...
+ */
+ glColor4f( 0.2f, 0.3f, 0.4f, 1.0f );
+ glBegin( GL_QUADS );
+ glVertex2i( menu->X - 2 , menu->Y + (menuID + 0)*FREEGLUT_MENU_HEIGHT + 1 );
+ glVertex2i( menu->X - 2 + menu->Width, menu->Y + (menuID + 0)*FREEGLUT_MENU_HEIGHT + 1 );
+ glVertex2i( menu->X - 2 + menu->Width, menu->Y + (menuID + 1)*FREEGLUT_MENU_HEIGHT + 2 );
+ glVertex2i( menu->X - 2 , menu->Y + (menuID + 1)*FREEGLUT_MENU_HEIGHT + 2 );
+ glEnd();
+ }
+ }
+
+ /*
+ * Print the menu entries now...
+ */
+ glColor4f( 1, 1, 1, 1 );