> Beat Steiner said:
>> - the resolution of the clock on Intel platforms is
>> quite low
> I see you are using 'ftime' - which I'd never heard of before.
(That wasn't it - I changed it to use ulClock and that didn't help.
It should use ulClock though - that's guaranteed to be portable and
the best available on any given platform).
The problem is in 'update_motion' in try1.cpp - it tests the 'delay'
variable and says to increase the number of penguins if there is more
than 20msec spare and decrease if there is less than 10ms spare!
Hence, at 50Hz (the default target frame rate) it always drops down
to 1 penguin because 50Hz == 20msec.
I changed the code to increase penguins so long as there is at least
4msec left and decrease penguins if there is less than 3ms left. As
a result, I got over 150 dancing penguins at something like 50Hz.
There are dangers to this approach though. You need hysteresis
in the loop to get rid of the flickering and the overload-one-frame,
Also, one should probably model the scene with several levels of detail
for each object and adjust the transition ranges according to overload.
In practical systems, you have to be still more careful because the
system can be overloaded in fill rate - which is both hard to detect
and hard to recover from.
Steve Baker (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: sjbaker@... http://www.link.com
Home: sjbaker1@... http://www.sjbaker.org