I am wondering what are my options when I want to do to jobs "simultaneously". In more words I would like for example (on a window):
-Every x seconds a square moves forward
-If you press a button a square stops
What is the way to go? I can think of a lot of ways to do it in a more "simple" language (like C) but I am more interested in actual code and functions. Like doing the job simple and efficiently
Merci beacoup (sp? its been years...)
I'm not sure what you mean by that, do you want to use separate threads ?
The ball moving is simple logic flow example,
Something like that ?
ballPos += ballVel * dt;
canMove = false;
How about just a Timer. Pretty simple to use although don't expect extremely high resolution. The nice thing about a Timer is behind the scenes it's just WM_TIMER messages, so you don't need to worry about marshalling gui editing code to the owning thread.
Originally Posted by C_ntua