Timer acting weird on AMD64x2

nobody wrote on Saturday, January 06, 2007:

OK, I just decided to finally finish a game i was working on a few months ago. So i start it up, and it’s acting weird. Animations and movements are “jerking” randomly. All of these are based on a frame time calculation i’m doing at the beginning of every frame, so i start printing the result of that calculation on screen, and i notice that it is negative whenever the jerks occur. The code is so simple it can’t be wrong :stuck_out_tongue_winking_eye:

ft = glfwGetTime() - lasttime;
lasttime = glfwGetTime();

So somehow glfwGetTime() must be returning a smaller number than it did for the previous frame to make ‘ft’ negative. Very odd. This worked fine before, but i’ve had a CPU upgrade since then, 32bit to 64bit dual core. I suppose that the new CPU could be causing some presicion errors, but i don’t know how.

Anyone got any ideas? Had similar problems?

- Lapskaus

elmindreda wrote on Saturday, January 06, 2007:

Yes, it’s a problem with the assembly code paths of the timing code. These code paths have been removed for the next version for that reason. In the meantime, you could either use the CVS version or I could send you a patch for your version of GLFW.

nobody wrote on Sunday, January 07, 2007:

I’d appreciate that :slight_smile: Any chance you can get me a precompiled .a file? I’m using the dev c++ package. Guess i can figure out how to compile it myself if i have to though…

my email is mortschu online.no

Thanks! :slight_smile:

- Lapskaus