🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1523

Improving Drawing Performance *sigh*

#1523
From: David Basiji
Date: Thu, 15 Oct 1992 17:52
35 lines
2102 bytes
Warning: I'm a newbie programmer on the NeXT.

I'm writing an app that plots thousands of white dots on a black plain.
The pattern of the dots is pretty random within a line but there are only
a few line types so I can assemble the 2-dimensional pattern by drawing
the different line types in the appropriate order.

Drawing performance is really bad and the "improving performance" section
of the on-line docs is not really helping.  The dots are being represented
as rectangles. There seem to be a few ways to do the job:

	1 many calls to PSrectfill on a dot by dot basis
	2 many calls to NXRectFill on a dot by dot basis
	3 fewer calls to NXRectFillList (line at a time, xforming coords)
	4 a single call to a huge NXRectFillList (the whole plain at once)
	5 a custom PSWrap for any of the above cases

In addition to good drawing perfomance, I want printing to be able to take
advantage of the resolution of the printer so that a pixel on the screen
is 1/400" in printed output. 

I've implemented my program using both methods (1) and (3). (1) seems 
to be much faster but I can't get the printing performance (it prints dots
of size comparable to screen pixels). 

Finally, I'm doing this in a subclass of View. I'd like to do it in a 
subclass of ScrollView so I could see the whole plain at high resolution.
I make a stab at it but I couldn't get the drawing to work properly; it
would overwrite parts of my app's window and wouldn't stay in its frame.
Any tips, pitfalls, common sense I should know about before trying to do
a scrollview?

Thanks to all you NeXTsperts in advance!

David Basiji
Technical Details
Message-ID: <1992Oct15.175248.409@u.washington.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!usenet.coe.montana.edu!news.u.washington.edu!stein.u.washington.edu!basiji

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!usenet.coe.montana.edu!news.u.washington.edu!stein.u.washington.edu!basiji
From: basiji@stein.u.washington.edu (David Basiji)
Subject: Improving Drawing Performance *sigh*
Message-ID: <1992Oct15.175248.409@u.washington.edu>
Keywords: many dots
Sender: news@u.washington.edu (USENET News System)
Organization: University of Washington
Date: Thu, 15 Oct 1992 17:52:48 GMT
Lines: 35