CS 320
Mar. 9, 2009
poly.c
from the class
home page, and add it to the project.
Hints:
time()
function returns the number of seconds since the
beginning of the ``Epoch:''
#include <time.h> #include <stdlib.h> int startTime = time(NULL);
sprintf()
function can be used to create the time
string:
#include <stdio.h> char timeString[80]; sprintf(timeString, "%2d:%02d:%02d", elapsedHours, elapsedMinutes, elapsedSeconds);
time()
call (Why is this inefficient?), or register a timer
callback (see documentation for gluttimerfunc
). If you use
gluttimerfunc
(and you should), why should you sample the time
more than once per second? What's a reasonable sampling period?