displaying forms rapidly without skipping frames.

John M McIntosh johnmci at smalltalkconsulting.com
Thu May 2 19:57:57 UTC 2002


>I am trying to show a collection of forms at a set rate.  I came up with
>this:
>
>formCollection do:
>	[:aForm| aForm display. (Delay forSeconds: (1/30)) wait.].
>
>the problem is that it is skipping many frames and getting about 3-4 fps
>instead of the 30 is should be.

See my note 3/11/02
[BUG] why is frame rate in 3.2.5 slower
& the followon note
towards an accurate delay....


The thing that might not be apparent is that you are asking to have 
Squeak sleep your process for 1/30 of second. However when your 
process will run again is dependent on what else is going on. So 
think of it as 1/30 sec + overrun error in the VM 0-16ms? + time 
taken for another higher priority process to complete or a process 
switch to occur.

In the orginal mpeg player the logic which is smalltalk accessible 
code btw would look at how many frames into the movie, versus the 
clock time and adjust how long to wait. For what you are doing you 
want to consider how long it is taking between calls to your delay 
routine and adjust things so that you are being called every 1/30 of 
second.

Mind if you can't do > 30 frames a second with no delay the effort is 
useless, however you might still need the code when Squeak and the 
machine become 10x faster in the next N years.


You could always make a  Morpic and rely on the step logic, which 
still in my opinion needs the fix mentioned above in [BUG] why is 
frame rate in 3.2.5 slower.

-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list