Revision 1 as of 2007-01-18 04:29:53

    GustavRydstedt/Assignment 1

Describe GustavRydstedt/Assignment 1 here.

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

Control is given to the user via call-back functions. Function-pointers are sent via functions such as glutDisplayFunc (for the display function).

What does the parameter to glutInitDisplayMode() in main() specify?

Parameters to gluInitDisplayMode sets up the initial display mode. In our example GLUT_RGBA sets up a Red, Green and Blue color schema with and alpha channel (for transparency). Another color schema is index-mode which indexes certain colors in a color map. GLUT_DOUBLE sets the display mode to use double buffering (alternating two display buffers) instead of GLUT_SINGLE; which is single buffering. Double buffering helps in smoothing animation.

What do the calls to glOrtho() and glViewport() in the reshape() function accomplish? If the window is to be resized, why might we want to change this?

glViewport changes the "viewing box"; that is, sets up the painting canvas for the program. glOrtho sets up the relative coordinate system. In the reshape function these are useful in either keeping the scene relative to the size of the window, or make it have constantsize whatever the window-size.

Recent