1 #include <GL/freeglut.h>
4 static int sequence_number=0;
6 static void Display(void)
8 int window=glutGetWindow();
9 printf ("%6d Window %d Display Callback\n",
10 ++sequence_number, window );
11 glClear ( GL_COLOR_BUFFER_BIT );
14 static void Entry(int state)
16 int window=glutGetWindow () ;
17 printf ("%6d Window %d Entry Callback: %d\n",
18 ++sequence_number, window, state);
20 static void SampleMenu(int a)
22 printf("Menu clicked %d\n", a);
24 int main(int argc, char *argv[])
26 int freeglut_window, menuID;
27 glutInitWindowSize(400, 250);
28 glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
29 glutInit(&argc, argv);
30 freeglut_window=glutCreateWindow("INVOKE_WCB Issue");
31 printf("window created\n");
32 glClearColor(1.0, .0, 1.0, 1.0);
33 glutDisplayFunc(Display);
34 glutEntryFunc(Entry) ;
35 menuID=glutCreateMenu(SampleMenu);
36 glutAddMenuEntry("Entry one", 1);
37 glutAddMenuEntry("Entry two", 2);
38 glutAttachMenu(GLUT_RIGHT_BUTTON);