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.