<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/16/14 10:46, wrote:<br>
    </div>
    <blockquote
cite="mid:C40B2F181831EF44A88CD73525827803130B16680D@MERCERMAIL.MercerU.local"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} p
        {margin-top:0;
        margin-bottom:0}p
        {margin-top:0;
        margin-bottom:0}--></style>
      <p>Okay!</p>
      <p><br>
      </p>
      <p>For displayFunc(), can we only call that once?</p>
      <p><br>
      </p>
    </blockquote>
    Generally yes -- you should only have one display function -- BUT --
    your display function can have multiple functions/methods etc.&nbsp; Most
    of the code in your programs will be tied to the display func. &nbsp;
    Once we hit animation the linkages between all of these glut
    functions will become clearer.&nbsp; <br>
    <br>
    <blockquote
cite="mid:C40B2F181831EF44A88CD73525827803130B16680D@MERCERMAIL.MercerU.local"
      type="cite">
      <p>
      </p>
      <p>For the interact.c, why is it necessary to erase the box? Why
        can't we run the initializing functions again?</p>
    </blockquote>
    <br>
    In this particular program eraseBox sets the color back to white
    (the background color) and replaces the selected pixels with that
    color.&nbsp; I've never tried calling init again.&nbsp; Give it a shot. &nbsp; In
    general, however, you only want to initialize your environment once
    and then do all of the manipulations within your code.&nbsp; Later on,
    when we start talking about all of the buffers and matrix stacks, if
    you reinitialize these you will throw away information related to
    the transforms on which you are working.&nbsp; Let's say you have a
    matrix stack that has transformed you into a new coordinate system
    for your viewport and another matrix stack that has transformed your
    model into a different orientation.&nbsp;&nbsp; If you reinitialize you would
    typically (at least in earlier versions of GL) loose all of the
    information stored in your matrix stacks -- and you have no way to
    re-create it.<br>
    <br>
    <br>
    <blockquote
cite="mid:C40B2F181831EF44A88CD73525827803130B16680D@MERCERMAIL.MercerU.local"
      type="cite">
      <p><br>
      </p>
      <p>How exactly does the glutMainLoop work?</p>
      <p><br>
      </p>
    </blockquote>
    <br>
    glutMainLoop runs the "callback processor".&nbsp; It is what looks for
    events that change in the state of the system and then calls the
    appropriate glut function (glutKeyboardFunc, glutDisplayFunc, etc.,
    to process the event.)&nbsp; <br>
    <br>
    <blockquote
cite="mid:C40B2F181831EF44A88CD73525827803130B16680D@MERCERMAIL.MercerU.local"
      type="cite">
      <p>
      </p>
      <p>For the rastered black box in parts 1 and 2 for the assignment,
        assuming its a function, would we call the rastering function in
        the initializing function or use the DisplayFunc? Why?</p>
    </blockquote>
    <br>
    I personally would call it in the displayFunc.&nbsp; Again, this is my
    preference because I like to separate out the pieces of the code to
    things that I am "initializing" and things that I am responsible for
    doing myself.&nbsp; As you will see later, I generally have individual
    functions for all of these things.&nbsp; I have had students set up the
    black box in both locations.<br>
    <br>
    <br>
    Great questions!&nbsp; Keep 'em coming!<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Andrew J. Pounds, Ph.D.  (<a class="moz-txt-link-abbreviated" href="mailto:pounds_aj@mercer.edu">pounds_aj@mercer.edu</a>)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
<a class="moz-txt-link-freetext" href="http://faculty.mercer.edu/pounds_aj">http://faculty.mercer.edu/pounds_aj</a>
</pre>
  </body>
</html>