🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

glutTimerFunc

Started by
3 comments, last by Ched45 23 years, 11 months ago
Hi I was looking through some sample sourcecode ( can''t remember where) and came across this void timf (int value) { glutPostDedisplay (); glutTimerFunc(40, timf, 0); //about 25FPS } I can use it, ok....but what is the calulation to fps. ( How does (40, timf, 0) turn out to be 25fps?) I tried changing the 40 for other numbers but can see no difference. --Ched-- --Ched-- chris@ched45.com
--Ched--chris@ched45.com
Advertisement
that is a function that just calls itself every 40ms (1000/40)==25fps.
i wouldnt use that to update the screen.
Ok, thanx. What would you use to update the screen?
thanx

--Ched--
chris@ched45.com
--Ched--chris@ched45.com
basically
glutDisplayFunc(drawScreen);
glutIdleFunc(drawScreen);

though u might wanna also call it after specific events keypress etc, unfortunatly glut is a bit unclear in this department.
K, thanx for your help and suggestions....I''ll give it ago


--Ched--
chris@ched45.com
--Ched--chris@ched45.com

This topic is closed to new replies.

Advertisement