View Full Version : glutTimerFunc timing problem

11-02-2004, 05:17 PM
I have a timer function that calls on a function to draw an object at a certain time. I get the time using this function:
time_elapsed = (clock()-startTime)/CLOCKS_PER_SEC;

My timer function calls itself again every 40ms seconds.
My problem is that time_elapsed increases extremely slowly (it seems to be stuck at 1 forever and probably increases more slowly) so my object is never drawn.
But if I make the timer call itself at values 100ms and higher, it works fine.

11-05-2004, 12:29 PM

Without more information, it's difficult to say, but you might look at your types?

When you have a division that gets stuck at 1 forever only when it's above a certain value, it implies a typing problem. You could just cast evertying (float) and see what changes...

Hope that helps