polylib
This library draws filled polygons fast, for 3D graphics. The points
of a polygon are pairs of words in memory, given by the address of the
first, as for Polyf; they must run clockwise, and the bitmap’s origin
set with BitMapOrigin is not used.
BitMapPoly draws on the used bitmap; with a dither bitmap, it fills
with a pattern of two lines taken from that bitmap. The Chunky... commands draw
on the chunky area of the used CopList, made by CustomChunky of the
display library: there each pixel is a colour register that the copper
changes, and a colour is a value for the register, such as $F00 for
red. RenderToBitmap and RenderToChunky choose where RenderPoly
draws, so that one program can draw on both. RenderPoly and
ChunkyPoly work in Blitz mode only.
BitMap 0,320,200,3
BLITZ
Dim pts.w(5)
pts(0)=10 : pts(1)=10 : pts(2)=100 : pts(3)=40 : pts(4)=20 : pts(5)=80
RenderToBitmap 0
RenderPoly 3,&pts(0),2A polygon has at most 16 points. With runtime error checking, more points are the error “Too Many Points”.
Library number 121.
Commands
BitMapPoly
Draws a filled polygon of numpts points in color on the used bitmap, with the blitter. With ditherbitmap, the colour is a pattern of two lines of that bitmap, from line color * 2 on.
Statement. Help text: numpts,*coords.w,color[,ditherbitmap]
2 forms:
.w, .l, .w.w, .l, .w, .w
The dither form expects the bitplanes of both bitmaps evenly spaced
in memory, as BitMap makes them.
ChunkyCLS
Fills the whole chunky area of the used CopList with color.
Statement. Help text: color
Arguments: .w
ChunkyPlot
Sets the pixel at x,y of the chunky area of the used CopList to color. With CLIP, a pixel outside the area is left alone; without it, nothing is checked.
Statement. Help text: x,y,color,[,CLIP]
2 forms:
.w, .w, .w.w, .w, .w, .w
ChunkyPoly
Draws a filled polygon of numpts points in color on the chunky area of the used CopList, with the blitter. With a fourth argument, whatever its value, it draws with the processor instead.
Statement. Help text: numpts,*coords.w,color[,noblitter]
2 forms:
.w, .l, .w.w, .l, .w, .w
ChunkyVlin
Draws a vertical line in color from y1 to y2 at column x of the chunky area of the used CopList. With CLIP, the line is cut at the top and bottom edges of the area, y1 and y2 may be given in either order, and an x outside the area draws nothing.
Statement. Help text: x,y1,y2,color,[,CLIP]
2 forms:
.w, .w, .w, .w.w, .w, .w, .w, .w
Without CLIP, nothing is checked and y1 must not be greater than
y2; with runtime error checking, it is the error “ChunkyVlin y1 MUST
NOT be greater than y2”.
RenderPoly
Draws a filled polygon of numpts points in color where RenderToBitmap or RenderToChunky chose.
Statement. Help text: numpts,*coords.w,color
Arguments: .w, .l, .w
Before the first RenderToBitmap or RenderToChunky it draws
nothing.
RenderToBitmap
Makes RenderPoly draw as BitMapPoly on the bitmap given, with the dither bitmap if it is given.
Statement. Help text: BitMap#[,DitherBitMap#]
2 forms:
.w.w, .w
RenderPoly draws on the first bitmap, with the pattern of the
second; Blitz Basic 2 took them the other way round
(RenderToBitmap with a dither bitmap drew on the wrong bitmap).
RenderToChunky
Makes RenderPoly draw as ChunkyPoly on the chunky area of the CopList given, or with a split of 1 on the second part of an area split by CustomChunky. The colour is then a number from 0 to 14 for a fixed set of colours.
Statement. Help text: CopList#[,split]
2 forms:
.w.w, .w
With runtime error checking, a colour above 14 is the error “Illegal
Colour” at RenderPoly.