🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Clearing the Window

#4818
From: John J. Szucs
Date: Fri, 10 Aug 1990 15:13
68 lines
2980 bytes
In article <1990Aug10.022609.9022@ariel.unm.edu> kchiu@carina.unm.edu writes:
>
>	Ok, this might sound like a stupid question,

The only kind of stupid question is an important one that isn't asked.

>but Is there a function
>for clearing the Window? Or do you have to fill the window with background
>color?

There is no function for clearing a window per se.

However, there are calls in graphics.library that can be used for this
purpose.

If you are using a GIMMEZEROZERO window (specified with the GIMMEZEROZERO
flag in the Flags field of the NewWindow structure):

 #define BACKGROUND_PEN 0 /* Define constant for background color */

struct Window *Window;

	...
	/* Set window to background color */
	SetRast(Window->RPort,BACKGROUND_PEN);
	...

This method applies only to GIMMEZEROZERO windows. However, the use of
GIMMEZEROZERO windows has an adverse effect on system performance and should be
avoided if at all possible.

For non-GIMMEZEROZERO windows (windows for which the GIMMEZEROZERO flag
in the Flags field of the NewWindow structure was not set):

 #define BACKGROUND_PEN 0 /* Define constant for background color */

struct Window *Window;

	...
	/* Set area and outline pens to background color */
	SetAPen(Window->RPort,BACKGROUND_PEN);
	SetOPen(Window->RPort,BACKGROUND_PEN);

	/* Set window to background color */
	RectFill(Window->RPort,Window->BorderLeft,Window->BorderTop,
		Window->Width-Window->BorderRight-1,
		Window->Height-Window->BorderTop-1);

For more information on windows and the graphics.library calls (including
SetRast and RectFill), see the Intuition and Graphics sections, respectively,
of the ROM Kernel Manual: Libraries and Devices and the includes and
AutoDocs files (all available for Commodore Applications and Technical
Support).

>						Thanks in advance.
>
>kchiu@carina.unm.edu

================================================================================
|| John J. Szucs                    || The opinions expressed are my own and  ||
|| Systems Evaluation Group         || in no way represent the opinions or    ||
|| Product Assurance Department     || policies of Commodore Technology, Inc. ||
|| Commodore Technology, Inc.       || or any associated entity.              ||
================================================================================
...{rutgers|uunet|pyramid}!cbmvax!jjszucs
jjszucs@cbmvax.commodore.com

"Everything is deeply intertwingled." - Ted Nelson, Computer Lib/Dream Machines
Technical Details
Message-ID: <13749@cbmvax.commodore.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jjszucs
References: <1990Aug10.022609.9022@ariel.unm.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jjszucs
From: jjszucs@cbmvax.commodore.com (John J. Szucs)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Clearing the Window
Message-ID: <13749@cbmvax.commodore.com>
Date: 10 Aug 90 15:13:33 GMT
References: <1990Aug10.022609.9022@ariel.unm.edu>
Reply-To: jjszucs@cbmvax (John J. Szucs)
Distribution: na
Organization: Commodore, West Chester, PA
Lines: 68