PT(3L)

NAME
pt: Pt, Rpt, Rect - create a Point or Rectangle from arguments

SYNOPSIS
#include <dmd.h>

Point Pt (x, y)
int x, y;

Rectangle Rpt (p, q)
Point p, q;

Rectangle Rect (a, b, c, d)
int a, b, c, d;

DESCRIPTION
These functions are special macros that are to be used only in an argument list to a function. They are functionally equivalent to the ones in fpt(3L) but are faster for the above situation.

The Pt argument passes a coordinate pair as a Point to a function.

The Rpt argument passes two Points as a Rectangle to a function.

The Rect argument passes four coordinates (two coordinate pairs) as a Rectangle to a function.

EXAMPLE
The following subroutine draws two boxes in the upper left corner of the window.

#include <dmd.h>
drawboxes()
{
	Point add();
	Rectangle raddp();
	box(&display,
	    Rpt(Drect.origin, add(Drect.origin, Pt(100,100))),
	    F_STORE);
	box(&display,
	    raddp(Rect(0,0,200,200), Drect.origin),
	    F_STORE);
}

SEE ALSO
fpt(3L).