Displaying directly on Display

Andreas Raab andreas.raab at gmx.de
Fri Mar 28 20:33:11 UTC 2003


Hi Jon,

Try this:

 	firstForm displayOn: Display at: 100 @ 100.
Display forceDisplayUpdate.
 	(Delay forMilliseconds: 3000) wait.
 	secondForm displayOn: Display at: 100 @ 100.
Display forceDisplayUpdate.
 	(Delay forMilliseconds: 100) wait.
 	firstForm displayOn: Display at: 100 @ 100
Display forceDisplayUpdate.

Otherwise the VM may delay the display update operation to a later point.
This optimization was originally added to avoid the extra overhead occuring
when you have overdraw (e.g., what you see happening is exactly what it
ought to do ;-) The VM will only "truly" update upon the next event request
(that is right before the user may be interacting with the system). This
little cheat allowed me to use Squeak quite reasonably on a 66MHz 486 ;-)

BTW, Morphic uses its own version of this regime - it actually tells the VM
to defer the display updates and later requests individual updates for
specific screen portions.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Jon Hylands
> Sent: Friday, March 28, 2003 8:38 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Displaying directly on Display
> 
> 
> 
> Hi everyone,
> 
> A friend of mine is trying to write an app that will flash 
> something on the
> screen for a small number of milliseconds (variable - between 
> say 50 and
> 300 ms).
> 
> We wrote some code that does it, but with the delay in 
> between displaying
> this box anything less than about 180 ms, it doesn't actually 
> appear on the
> display.
> 
> Basically, he's got a Form, say about 150 x 120 in size, and is doing
> something like this:
> 
> 	firstForm displayOn: Display at: 100 @ 100.
> 	(Delay forMilliseconds: 3000) wait.
> 	secondForm displayOn: Display at: 100 @ 100.
> 	(Delay forMilliseconds: 100) wait.
> 	firstForm displayOn: Display at: 100 @ 100
> 
> So, we get the first form for 3 seconds, and then the second form is
> supposed to appear for say 100 ms, and is then replaced by 
> the first form
> again.
> 
> The problem is the form doesn't actually show up on the 
> screen at all. Is
> there some background process that is gathering copyBits 
> calls in the VM
> and then only updating the screen once in a while?
> 
> I know we can do this using the #step function and a morph, 
> but right now
> we've already implemented it this way without Morphic, and 
> I'd love to know
> what the problem is...
> 
> BTW, he's running 3.4, with the display depth set to 16 bits, 
> running on
> Windows NT. I tried the same thing on my laptop, running XP, 
> and got the
> same behavior...
> 
> Later,
> Jon
> 
> --------------------------------------------------------------
>    Jon Hylands      Jon at huv.com      http://www.huv.com/jon
> 
>   Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
>            http://www.huv.com
> 



More information about the Squeak-dev mailing list