MattRix_Of_Smeg
11-03-2005, 10:01 PM
Ok basically I am looking to create a menu in C++, the problem is the notes I have are pish.
I have taken the notes and basically got this rough garbage:
void MyMenu(int submenu_id)
{
int submenu_id = glutCreateMenu(MySubMenu);
// Adding sub menu entry
glutAddMenuEntry("First Sub Menu", 1);
glutAddMenuEntry("Second Sub Menu", 2);
glutCreateMenu(MyMenu);
glutAddMenuEntry("First Menu", 11);
glutAddMenuEntry("Second Menu", 7);
glutAddMenuEntry("Third Menu", 8);
glutAddMenuEntry("Fourth Menu", 1);
glutAddMenuEntry("Fifth Menu", 2);
glutAddSubMenu("Sub Menu", submenu_id);
glutAddMenuEntry("Quit", 3);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
Now, what I want to know is... how the HELL do I make this work into a menu? :saywhat: I get two errors when I try and compile it with the other code I have:
1) redefinition of formal parameter 'submenu_id'
2) 'MySubMenu': undeclared identifier
I am not sure if I have to declare anything at the top, but if any of you kind smart folks can tell me what to edit in the above code hopefully it will all work out for me.
Cheers
:beer:
I have taken the notes and basically got this rough garbage:
void MyMenu(int submenu_id)
{
int submenu_id = glutCreateMenu(MySubMenu);
// Adding sub menu entry
glutAddMenuEntry("First Sub Menu", 1);
glutAddMenuEntry("Second Sub Menu", 2);
glutCreateMenu(MyMenu);
glutAddMenuEntry("First Menu", 11);
glutAddMenuEntry("Second Menu", 7);
glutAddMenuEntry("Third Menu", 8);
glutAddMenuEntry("Fourth Menu", 1);
glutAddMenuEntry("Fifth Menu", 2);
glutAddSubMenu("Sub Menu", submenu_id);
glutAddMenuEntry("Quit", 3);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
Now, what I want to know is... how the HELL do I make this work into a menu? :saywhat: I get two errors when I try and compile it with the other code I have:
1) redefinition of formal parameter 'submenu_id'
2) 'MySubMenu': undeclared identifier
I am not sure if I have to declare anything at the top, but if any of you kind smart folks can tell me what to edit in the above code hopefully it will all work out for me.
Cheers
:beer: