[CSC 315] glutTimerFunc
Andrew J. Pounds
pounds_aj at mercer.edu
Sun Nov 25 09:20:32 EST 2018
I am seeing several of you make calls to glutTimerFunc in your codes.
I'm sure you probably found some online example that used this and
thought it was a good idea -- but stop. Timers are used primarily to
synchronize events. In the codes you are writing there is already a
built in timer based on the framerate of the hardware you are using.
To ensure that we are hitting every frame possible we use glutIdleFunc.
Making a call to glutTimerFunc adds a step and -- under badly coded or
misunderstood conditions -- can cause the graphics systems to lock up.
For those continuing on to CSC 415 -- you will see this function again
and where its use is appropriate. You will also see how much the window
manager - and calls to the window manager functions -- can drain the
resources that we desperately need to get "realistic" rederer performance.
--
Andrew J. Pounds, Ph.D. (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20181125/86271080/attachment.html>
More information about the csc315
mailing list