[FIX] simplerMorphicLoop-ls

lex at cc.gatech.edu lex at cc.gatech.edu
Thu Jul 10 23:52:45 UTC 2003


Yikes, a comment from John McIntosh got me looking at the old
interCyclePause: method, and it has gotten kinda crufty over the years! 
This changeset cleans a few things up.   

By the way, as the earlier thread noted, the intercycle pausing logic
relies on Delay waking up promptly.  If the Delay wakes up late, then
your frame rate will be slightly lower than the delayer is aiming for.

-Lex


from preamble:

"Change Set:		simpleMorphicDelay-ls
Date:			10 July 2003
Author:			Lex Spoon

This simplifies a few things involving the interCycleDelay: method.

First, the old semantics have been put back: MinCycleLapse is the
minimum time for a single cycle, not the minimum time *between* cycles. 
If Morphic is pegging the CPU and still only obtaining 10 fps, then
there is no need to pause between cycles.

Second, the Delay has been put into a while loop instead of an if
statement: now the method delay's over and over again until the full
desired pause has been achieved.  Since this does provide better
accuracy, it seems that Delay is returning early sometimes.  Weird!!

Third, the check for a change of screen size has been moved to a place
where it will get called more reliably.
In particular, it will get called even if Morphic ends up not delaying
at all between two cycles, e.g. if a large BouncingAtomsMorph is open on
the screen.

Additionally, it looks to me like the CanSurrenderToOS stuff could go
away now that we have mouse events transmitted through VM's.  In current
VM's, the ioRelinquishProcessorForMicroseconds: primitive should wake up
whenever the mouse moves, anyway, and so there seems sto be no point in
avoiding going to sleep.  However, maybe I misunderstand what's going on
with it, and so I've left it for now."
!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simplerMorphicLoop-ls.cs.gz
Type: application/octet-stream
Size: 1705 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030710/676ce2c3/simplerMorphicLoop-ls.cs.obj


More information about the Squeak-dev mailing list