1. In a GLUT program, how is control passed back to the programmer? How is this set up during initialization?

Control is passed to the programmer in the form of callback functions (functions that will be called when events occur, e.g. when the window needs to be drawn or when a key is pressed). This is set up during initialization through calls to functions such as glutDisplayFunc, glutReshapeFunc and glutKeyboardFunc. Each of these functions takes as an argument a function pointer indicating the function to be called when that event occurs.

2. What does the parameter to glutInitDisplayMode() specify?

The mode parameter controls options such as the color model (GLUT_RGB, GLUT_RGBA or GLUT_INDEX) and buffering of color buffers (GLUT_SINGLE or GLUT_DOUBLE). The value passed is a logical OR of these options.

last edited 2007-01-13 05:36:36 by sheep