Thread View: comp.sys.acorn.tech
6 messages
6 total messages
Started by SMARTIN
Mon, 28 Sep 1992 09:36
Flicker-free Icon updating
Author: SMARTIN
Date: Mon, 28 Sep 1992 09:36
Date: Mon, 28 Sep 1992 09:36
24 lines
1680 bytes
1680 bytes
I am writing an application that requires a number of text icons to be updated fairly regularly (frequency definable by the user). Currently, I am using the SWI SetIconState with zero arguments to force an update, but if the update frequency is more than a few frames per second, the flicker is quite intolerable with or without icon borders. I have also tried the SWIs ForceRedrawWindow and UpdateWindow (names may be slightly wrong), but this does not improve things. My question is, is it possible to use the old GCOL type tricks by EORing text into the Icon? If so, how is this done ? If not, will updating the Icon as a Sprite help ? Any other hints on how I could rid myself of this annoying flicker would be greatly appreciated. I am sure that all this information is in the PRMs, but I am reluctant to get a copy until the RO3 version is available (I have an A5000). I am sort of hoping that if will be available for the Acorn User Show (which fortunately coincides with my next visit to England :-)). Is this a real possibility, or am I living in dream world ? ----------------------------------------------------------------- Stuart Martin (Logica at ESOC) smartin@esoc.bitnet Any opinions expressed in the above posting are in no way intended to represent the official opinions of either Logica or ESOC.
Re: Flicker-free Icon updating
Author: Torben AEgidius Mogensen
Date: Mon, 28 Sep 1992 14:06
Date: Mon, 28 Sep 1992 14:06
20 lines
1421 bytes
1421 bytes
<SMARTIN@ESOC.BITNET> writes: >I am writing an application that requires a number of text icons to be >updated fairly regularly (frequency definable by the user). Currently, I >am using the SWI SetIconState with zero arguments to force an update, but >if the update frequency is more than a few frames per second, the flicker >is quite intolerable with or without icon borders. I have also tried the >SWIs ForceRedrawWindow and UpdateWindow (names may be slightly wrong), but >this does not improve things. My question is, is it possible to use the old >GCOL type tricks by EORing text into the Icon? If so, how is this done ? >If not, will updating the Icon as a Sprite help ? >Any other hints on how I could rid myself of this annoying flicker would be >greatly appreciated. You could try waiting for the vertical sync before updating. In Basic this is done by WAIT, but there is an Os_Byte call (I don't recall the number) that has the same effect. Torben Mogensen (torbenm@diku.dk)
Re: Flicker-free Icon updating
Author: Philip Richard Banks
Date: Mon, 28 Sep 1992 19:56
Date: Mon, 28 Sep 1992 19:56
18 lines
1429 bytes
1429 bytes
In article <1992Sep28.140636.11131@odin.diku.dk> torbenm@diku.dk (Torben AEgidius Mogensen) writes:
>You could try waiting for the vertical sync before updating. In Basic
>this is done by WAIT, but there is an Os_Byte call (I don't recall the
>number) that has the same effect.
It is an OsByte 19 that waits for Vsync. The only problem I have found with
this is that having the window up near the top of the screen still causes
flickers. The simple answer I think is that you can't avoid flicker entirely
in the Wimp, merely lessen it's noticability...
Philip
--
Philip R. Banks pbanks@comp.vuw.ac.nz (An Arc owner with a mission) @@@@@/|
(Quite what mission I am not too sure yet. But I do have one!) @@@@/#|
"There may be an om in moment,but there's very few folk in focus!" @@@/--|
--'Hallowed be thy Name' by Emerson,Lake & Palmer. @@/###|
Re: Flicker-free Icon updating
Author: TMOTA
Date: Tue, 29 Sep 1992 02:45
Date: Tue, 29 Sep 1992 02:45
36 lines
2522 bytes
2522 bytes
SMARTIN@ESOC.BITNET writes: >I am writing an application that requires a number of text icons to be >updated fairly regularly (frequency definable by the user). Currently, I >am using the SWI SetIconState with zero arguments to force an update, but >if the update frequency is more than a few frames per second, the flicker >is quite intolerable with or without icon borders. Well, as others have said, you can call Os-Byte 19 / *FX19 / WAIT just before causing update. THis works well, except near the top of the screen, and aslo has the drawback of slowing things down a lot if you update many times a second (especially if other programs are also WAITing... An ARM-3 machine can do up to around 260,000 instructions in the time it takes to do a WAIT!) Another trick that can reduce flicker substantially is to draw your info into a sprite, and then SetIconState,0,0 the icon containing the sprite. This should be near flicker-free without a WAIT, but a WAIT as well should make it very good. Minimising the area of the screen can help a lot too. If you have something like "Reading file: 10%", all you really need to update is the percentage, and so you can stop the flicker of the text "Reading file" completely. As you are drawing less (2 characters only now), the redraw is faster, so the flicker on the updated number is also reduced. The last trick is to think about what info you are updating - does it need to be updated so frequently? You could read the time when you update the icon (SWI "OS_ReadMonotonicTime" TO timenow) and refuse to update the icon until the new time is > 25 centiseconds or so, giving a maximum speed of update of 4 updates a second... When doing a lot of stuff you can end up continuously redrawing the icon and doing very little processing, and this can stop that type of problem from happening. -- _________________ "I'd like to answer this question in two ways: /____ _ _/_ __ First in my normal voice, and then // / //_//_ /_/ in a silly, high-pitched whine." (Monty Python)
Re: Flicker-free Icon updating
Author: Simon B Proven IE91
Date: Tue, 29 Sep 1992 13:48
Date: Tue, 29 Sep 1992 13:48
12 lines
865 bytes
865 bytes
In article <1992Sep28.140636.11131@odin.diku.dk> torbenm@diku.dk (Torben AEgidius Mogensen) writes: >You could try waiting for the vertical sync before updating. In Basic >this is done by WAIT, but there is an Os_Byte call (I don't recall the >number) that has the same effect. It's OS_Byte 19 > Torben Mogensen (torbenm@diku.dk) mad@bike My other bike's a recumbent :)
Re: Flicker-free Icon updating
Author: Graham Allan
Date: Tue, 29 Sep 1992 14:10
Date: Tue, 29 Sep 1992 14:10
23 lines
1593 bytes
1593 bytes
In article <92272.103620SMARTIN@ESOC.BITNET> SMARTIN@ESOC.BITNET writes: >I am writing an application that requires a number of text icons to be >updated fairly regularly (frequency definable by the user). Currently, I >am using the SWI SetIconState with zero arguments to force an update, but >if the update frequency is more than a few frames per second, the flicker >is quite intolerable with or without icon borders. I have also tried the >SWIs ForceRedrawWindow and UpdateWindow (names may be slightly wrong), but >this does not improve things. My question is, is it possible to use the old >GCOL type tricks by EORing text into the Icon? If so, how is this done ? >If not, will updating the Icon as a Sprite help ? I already replied by mail, but, unless you need the extra functions of icons (detecting clicks, etc), I would suggest ditching them and doing text update manually by your program. The main programming effort lies in working out where to plot the updates, from the window work area and the scroll offsets, but once this is done, it is fairly easy to make your redraw routine. The speed difference between this and using icons is large. - Graham gta@st-andrews.ac.uk allan@mnhep8.hep.umn.edu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads