This has been driving me nuts. It was a bug that would cause the liquid hazards to stop animating. Turns out to be a bug in XNA.
I was using ElapsedRealTime.TotalMilliseconds to tell me the time between frames. Should be around 16.6 for 60fps. This was all over the place when I had a steady framerate. Then it would go to 0.0, so no animating. I switched to ElapsedGameTime.TotalMilliseconds and it works great. They should be equal, but by outputing them, I can see that ElapsedRealTime is all over the place.
The difference is ElapsedRealTime is the clock time and ElapsedGameTime is from the startup of the code. The games should be the same. I think this may have something to do with throttling in a multicore CPU. I have an i7, which is a quad-core (comes up as octo-core in Task Manager).
No comments:
Post a Comment