Drawing and filling lines and shapes

Drawing in ProXL is fairly straightforward, and quite powerful. ProXL has primitives to

Programming in ProXL requires a certain way of looking at drawing and graphics in general. Think of a line or an ellipse not as an permanent object, but as a temporary pattern of pixels on the screen. When you draw a line, you are turning bits on. The next thing you do may turn them off. Or they may be turned off when a user overlays your window with another. The line that you draw has no permanence. This property of X, call it procedural drawing, makes for a programming style in which you first open the windows you will need, and then do all drawing in callback routines (pxl-bas-tyi-cbk). If you want the line to seem to stay around, you have to explicitly provide for it to be repainted whenever it is damaged or obscured by a later event; see pxl-bas-tyi-rfr on refreshing windows.

The primitives for drawing or filling a single shape take just the arguments you would expect:

The primitives for drawing or filling multiple objects are also fairly simple. They each take

In all of the drawing commands, and elsewhere in ProXL, the X coordinates are given relative to the left edge of the enclosing window , and Y coordinates are given relative to the top edge.