No, it's not more efficient.. simply, setting to done the method is called again and again forever (until it have done set to true). That's why it consumes all the cpu time.Originally Posted by lnpneil
If you use TDxTimer and set interval to 0, you get the same situation: the event handler is called again and again.
In both case you can set pauses in the cicle, setting the timer interval to a nonzero value or using the instruction slepp() in the Idle event.
Pauses are used if you need a fixed fps. Fixed fps is usually good for 2d (that's no need to get a fps faster than 30), but 3d games usually try to do as many cicle as they can, adjusting the world movement by the reciprocal of fps (ie: if fps=20 move the character by 10, if fps=40 move the character by 5)
PS: for alimonster: your last link is broken, you must add an "L" at the end
Bookmarks