Hi all:
How can I add menu entries into the sub menu? I went through the GLUT API reference. It introduced how to add menu entries and add submenu but didn’t mention how to add entries into the submenu and how to catch that event. I tried several ways but no one works.
All the menu entries appear in the pop-up menu but not the submenu “sub1” in the following code.
void MenuSetting(){
int menu = glutCreateMenu(MenuFunc);
glutAddSubMenu("sub1", menu);
glutAddMenuEntry("Cylinder", CYLINDER);
glutAddMenuEntry("Torus", TORUS);
glutSetMenu(menu);
glutAddMenuEntry("Exit", EXIT);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
Could anybody tell me how to solve this please!
Thanks very much!!!