X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2Fsmooth_opengl3%2Fsmooth_opengl3.c;h=93e708d1c625957491cb3c04ca329937ef2d2fd2;hb=369e02f3912ca0f768d98e49fb1198e80f44e078;hp=3d8e2790cc471ae627c26264d4b1f7b72a933271;hpb=b7f5a290ecf16149bfa77e89dbfb5197cebe88f1;p=freeglut diff --git a/progs/demos/smooth_opengl3/smooth_opengl3.c b/progs/demos/smooth_opengl3/smooth_opengl3.c index 3d8e279..93e708d 100755 --- a/progs/demos/smooth_opengl3/smooth_opengl3.c +++ b/progs/demos/smooth_opengl3/smooth_opengl3.c @@ -434,8 +434,12 @@ void keyboard(unsigned char key, int x, int y) } } +void samplemenu(int menuID) +{} + 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 */ @@ -451,6 +455,15 @@ int main(int argc, char** argv) 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); + glutAddMenuEntry("Sub menu A1 (01)",1); + glutAddMenuEntry("Sub menu A2 (02)",2); + glutAddMenuEntry("Sub menu A3 (03)",3); + glutSetMenu(menuA); + glutAttachMenu(GLUT_RIGHT_BUTTON); + glutMainLoop(); return 0; }