If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Trying to multithread program. C++/CLI

yea i've never heard of a .net 4.3 either actually but i figured i'd take his word for it. I'll try and inclue the .NET framework installation with my setup program will be easier than making people install it manually. i'll also include the 2012 redistributables.

So you think i should use a Timer and on every timer tick draw everything whilst continuously doing the calculations required??
Or do you mean Update and Draw on one timer tick but use the stopclock just to keep track of the time taken to put into my calculations??

Re: Trying to multithread program. C++/CLI

So you think i should use a Timer and on every timer tick draw everything whilst continuously doing the calculations required??

I'm not quite sure what you mean by "continuously", but if that involves a loop, then definitely no.

Or do you mean Update and Draw on one timer tick but use the stopclock just to keep track of the time taken to put into my calculations??

Yes, that's what I meant. It's easy when the calculations you perform in any simulation step just depend on time and some parameters that remain constant over the simulation run (of course it's absolutely fine to change parameters between simulation runs). If, however, your calculations also depend on results obtained in the previous step, it may become more complicated, since the timespan elapsed between steps may not be constant (which actually is the gist of the game loop approach).

But don't do any actual drawing in the timer tick handler. Just update your simulation parameters and call Invalidate(), which will result in OnPaint() being called, where you then do the actual drawing based on the updated simulation parameters, much like you're already doing in the code you uploaded.

To reduce CPU load caused by repainting, you may just invalidate the area that actually has changed rather than the entire form, sort of what is described in http://forums.codeguru.com/showthrea...92#post2005192. But CPU load probably won't be so dramatic either way.

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.