🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4374

Re: Graphics, clipping, and double-buffering in a window

#4374
From: Jean-Michel Forgeas
Date: Sun, 15 Jul 1990 15:09
42 lines
2380 bytes
In article <357@tlvx.UUCP> sysop@tlvx.UUCP (SysOp) writes:
>What I'm trying to do at the moment is make a double-buffered display.
>If I draw into a window's rastport, I can go beyondthe edges (it'll clip
>for me).

Yes, because Intuition attach a layer with every window's RastPort.
See Window->RPort->Layer

>If I create my own bitmap & rastport, it doesn't seem to be
>clipping.  I'm sure this is obvious to someone.  :-)  Can I have the OS
>clip my separate rastport for me?

Yes you can. The graphics routines look at the RastPort->Layer, if it is
NULL, they do not clip, if not NULL they get all information from the
Layer like the clip rectangle, if it is partially obscured or not...

>How slow are the built-in clipping routines?  I could always have my own
>draw function which clips the x & y before calling Draw(), but I'd rather
>use the system functions if there's nothing wrong with the performance.

Clipping routines are fast, but they are designed for complex situations.
In some case perhaps you can do faster clipping if you really need speed.

>...ClipBlit to copy from the spare rp to the window's.  This was the most
>successful thing I tried, but I still get a flicker, even though I do...

Extracted from autodocs:
   "ClipBlit() performs the same function as BltBitMap(), except that it
   takes into account the Layers and ClipRects of the layer library..."
So if you have your own clipping, use BltBitMap() instead of ClipBlit().
Autodocs tell that BltBitMap() is not optimised. If you have flicker and
your BitMap is used exclusively by your program you could access directly
the blitter to copy the array.

>Gary Wolfe, SYSOP of the Temporal Vortex BBS

--
                                            \___/
Jean-Michel Forgeas                          \-/
cbmvax!cbmbsw!cbmsup!cbmfra!swinjm!forgeas    |    The Software Winery
                                             -^-
                                 And, where is the universe ?
Technical Details
Message-ID: <forgeas.1437@swinjm.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cbmvax!cbmehq!cbmfra!swinjm!forgeas
References: <357@tlvx.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cbmvax!cbmehq!cbmfra!swinjm!forgeas
From: forgeas@swinjm.UUCP (Jean-Michel Forgeas)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Graphics, clipping, and double-buffering in a window
Message-ID: <forgeas.1437@swinjm.UUCP>
Date: 15 Jul 90 15:09:17 GMT
References: <357@tlvx.UUCP>
Lines: 43