Using XNA 4.0.
For my purposes, I need exactly one Update call for every Draw call. I also want the game to run at a maximum speed of 60Hz. I also want it to decrease as necessary. Currently, my attempt at doing most of this is:
this.IsFixedTimeStep = false;this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, (int)Math.Round(1000.0f/60.0f));
When in a shader-heavy section of the game, the framerate appears fairly brisk, but then it stalls for a fraction of a second, throwing carefully timed events into a tizzy. This recurs, making the game unplayable. I don't understand this behavior. As far as I can tell, I'm not causing much garbage collection; the problem only seems to occur when running fragment-shader heavy code.
Help? Thanks,
-G