im trying to create a popup menu, but when i try to register the callback for the menu, i get this error…
minicad.cpp: In function ‘void mouse(int, int, int, int)’:
minicad.cpp:43: error: ‘selectObject’ was not declared in this scope
here is my code…
void mouse(int button, int state, int x, int y){
glutCreateMenu(selectObject);
glutAddMenuEntry(“Sphere”,1);
glutAddMenuEntry(“Cube”,2);
glutAddMenuEntry(“Torus”,3);
glutAddMenuEntry(“Iconsahedron”,4);
glutAddMenuEntry(“Octahedron”,5);
glutAddMenuEntry(“Tetrahedron”,6);
glutAddMenuEntry(“Dodecahedron”,7);
glutAddMenuEntry(“Cone”,8);
glutAddMenuEntry(“Teapot”,9);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}
void selectObject(int id){
glutPostRedisplay();
}