}
}
+void samplemenu(int menuID)\r
+{}
+
int main(int argc, char** argv)
{
+ int menuA;
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
/* add command line argument "classic" for a pre-3.x context */
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc (keyboard);
+
+ /* Add a menu. They have their own context and should thus work with forward compatible main windows too. */
+ menuA = glutCreateMenu(samplemenu);\r
+ glutAddMenuEntry("Sub menu A1 (01)",1);\r
+ glutAddMenuEntry("Sub menu A2 (02)",2);\r
+ glutAddMenuEntry("Sub menu A3 (03)",3);
+ glutSetMenu(menuA);\r
+ glutAttachMenu(GLUT_RIGHT_BUTTON);
+
glutMainLoop();
return 0;
}