home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Fastest way to clear a Window?
- Date: 10 Feb 1996 22:24:24 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Message-ID: <4fj5uo$1lo@maureen.teleport.com>
- References: <4fck5b$7mm@leofric.coventry.ac.uk> <4fcush$58b@apoll.informatik.uni-bonn.de>
- NNTP-Posting-Host: kelly.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Andreas Malerz (malerz@athene.informatik.uni-bonn.de) wrote:
- : Dave Jackson (dj@coventry.ac.uk) wrote:
- : : I'm writing a 3d graphics viewer thingy using intuition windows. What I
- : : want to know is, what is the fastest way of clearing a window? At the
- : : moment I'm using SetRast() but there must be a faster way. I'm using a
- : : custom screen, so I could make it draw lines on a single bitplane and
- : : then just clear that one plane, but the RKM:Libraries has nothing on how
- : : to clear one plane... help!
-
- : : TIA
- : : Dave Jackson
-
- : Depending on your processor, you can try to do it with the CPU itself.
- : The fastest way I know is the following:
-
- : Save all registers on STACK
- : Save STACK-Pointer somewhere else
-
- : Clear all registers
- : Put the Address of your bitplane in one Adressregister
- : Copy the registers to your plane with "movem"
- : Do the last step as often as necessary.
-
- : Restore STACK-Pointer
- : Restore all registers.
-
- : This solution is systemfriendly and on a fast processor faster than the
- : blitter.
-
- Thats a VERY ugly solution, since you need to stop multitasking/interupt.
- (So add disable()/enable() in you code :)
-
- I think its not that much faster (if at all) then just using
-
- .. REPEAT 64
- move.l d0,(a0)+
- ENDR
- loop ..
-
- Also I would really think twice before waisting so much CPU just clearing
- slow memory... You might be able to do something in betwen the 'clear'
- instructions.
-
- For layered window you want the os to call you for each cliped region
- and do a 3 pass clear... 32bit masked left/right side, then simple move
- for the the middle. The OS probably use the blitter and use a A/B/D mode for
- the full clear area , plus use cpu busy wait loop.
- My guess is that you can clear window background ~4time faster
- using custom code with 32bit chip VS the OS, and you still have the
- full blitter to be used for something usefull.(The OS will hug the cpu
- doing nothing will it very ineficiently clear)
-
- But I dont think the original poster actually want to clear an intuition
- window when doing 3d....
-
- Stephan
-