Question

I am trying to run an evolutionary algorithm using xna

i would like only to run the logical side of the game and after a long caculation time add the animation.

Does anybody know how to accelerate calculation time and disable the Draw() call.

Thanks

Was it helpful?

Solution

Just don't draw in your Draw method. You can keep a counter or a time stamp as reference, and only draw once out of 100 times or once per second. However, your problem is not the number of times Draw is called, but the number of times Update is called. By default, XNA will never call Update more than 30/60 times per second. You can change the frame rate XNA tries to achieve as explained in this post. To call Update 100 times per second, just change the target elapsed time in your game to:

this.TargetElapsedTime = TimeSpan.FromSeconds(1.0f / 100.0f);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top