FORTRAN (libfgl.a)
void rect (Coord x1, Coord y1, Coord x2, Coord y2)
void recti (Icoord x1, Icoord y1, Icoord x2, Icoord y2)
void rects (Scoord x1, Scoord y1, Scoord x2, Scoord y2)
SUBROUTINE RECT(x1, y1, x2, y2) REAL x1, y1, x2, y2
SUBROUTINE RECTI(x1, y1, x2, y2) INTEGER*4 x1, y1, x2, y2
SUBROUTINE RECTS(x1, y1, x2, y2) INTEGER*2 x1, y1, x2, y2
Note: For FORTRAN users, the INTEGER*2 version, the RECTS subroutine, should not be called with integer constant parameters. For example, 2 is an integer constant; JJ is an integer variable. The XL FORTRAN compiler, invoked by the xlf command, stores all integer constants as long integers (INTEGER*4), not as short integers (INTEGER*2). Invoking the short version of this subroutine with an integer constant will result in unexpected behavior.
The rect subroutine draws a rectangle using the current line attributes: linestyle, linewidth, color, and writemask. The sides of the rectangle are parallel to the x and y axes. Since a rectangle is a 2-D shape, the rect subroutine takes only 2-D arguments, and sets the z coordinate to zero. The current graphics position is set to (x1, y1) after the rectangle is drawn.
The syntax for each of the subroutine forms is the same except for the first argument. They differ only in that rect expects real coordinates, recti expects integer coordinates, and rects expects short integer coordinates.
The example C language program tpbig.c uses the recti subroutine to draw the outline of a rectangle in green.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
/usr/include/gl/gl.h | Contains C language constant and variable type definitions for GL. |
/usr/include/gl/fgl.h | Contains FORTRAN constant and variable type definitions for GL. |
Drawing a polygon with the poly subroutine.
Drawing a filled rectangle with the rectf subroutine.
AIX Graphics Library Overview, Setting Drawing Attributes, Drawing Rectangles, Circles, Arcs, and Polygons.