*void glutMenu(void)
{
int glut_menu[1];
glut_menu[0] = glutCreateMenu(NULL);
glutAddMenuEntry("Add Point",1);
glutAddMenuEntry("Delete Point",2);
glutAddMenuEntry("Scale",3);
glutAddMenuEntry("Rotate",4);
glutAddMenuEntry("Exit",5);
glutAttachMenu(GLUT_LEFT_BUTTON);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
of course the exit should exit, and the other should call a function to do the specified command.
I also call glutMenu(); in the main, but i don''t know what to do past that.
A GLUT menu question.
how do i set up a menu in GLUT, i thought i had it right, but appearently i don''t, so i could use some help. Here is what i want to have on my menu:
Add Point
Rotate Point
...
Exit
unfortantly, i can''t get it. Here is what i have for the menu, where am i screwing up. It is probably big.
taken from one of the glut examples
void menu(int value)
{
switch(value) {
case 1:
twopass = 0;
break;
case 2:
twopass = 1;
break;
}
glutPostRedisplay();
}
// in the init code
glutCreateMenu(menu);
glutAddMenuEntry("GL_LINEAR depthcueing", 1);
glutAddMenuEntry("\"add fog\" post-render depthcueing", 2);
glutAttachMenu(GLUT_RIGHT_BUTTON);
void menu(int value)
{
switch(value) {
case 1:
twopass = 0;
break;
case 2:
twopass = 1;
break;
}
glutPostRedisplay();
}
// in the init code
glutCreateMenu(menu);
glutAddMenuEntry("GL_LINEAR depthcueing", 1);
glutAddMenuEntry("\"add fog\" post-render depthcueing", 2);
glutAttachMenu(GLUT_RIGHT_BUTTON);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement