The following 111 words could not be found in the dictionary of 615 words (including 615 LocalSpellingWords) and are highlighted below:

accomplish   allows   an   and   area   argument   at   back   be   between   buffering   buffers   call   callback   called   calls   canvas   clipping   color   Control   control   controls   coordinate   corner   defines   Display   displayed   does   drawn   during   Each   event   events   example   For   form   frame   Func   function   functions   gl   glut   How   how   in   In   indicate   indicates   indicating   Init   initialization   Its   key   Keyboard   left   logical   lower   mapping   mode   Mode   model   needs   occur   occurs   of   on   only   options   or   Ortho   parameter   parameters   part   passed   pixels   pointer   position   pressed   program   programmer   rectangular   relative   Reshape   right   screen   set   should   specify   such   takes   that   The   the   these   this   This   through   to   up   upper   us   use   used   value   vertex   Viewport   What   when   which   will   window  

    RyanPropper/Assignment1Answers

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.

3. What do the calls to glOrtho() and glViewport() accomplish?

glOrtho() defines a clipping window, i.e. a mapping between a relative coordinate frame and the pixels displayed on-screen. For example, the call glOrtho(-1., 1., -1., 1., -1., 1.) indicates that a vertex at position (-1, -1) should be drawn in the lower-left corner of the window, and that a vertex at (1, 1) should be drawn in the upper-right.

glViewport() allows us to use only part of the window as the "drawing canvas." Its parameters (in pixels) indicate which rectangular area should be used.

Recent