Draws a screen-aligned rectangle.
FORTRAN (libfgl.a)
void sbox (Coord x1, Coord y1, Coord x2, Coord y2)
void sboxi (Icoord x1, Icoord y1, Icoord x2, Icoord y2)
void sboxs (Scoord x1, Scoord y1, Scoord x2, Scoord y2)
SUBROUTINE SBOX(x1, y1, x2, y2) REAL x1, y1, x2, y2
SUBROUTINE SBOXI(x1, y1, x2, y2) INTEGER*4 x1, y1, x2, y2
SUBROUTINE SBOXS(x1, y1, x2, y2) INTEGER*2 x1, y1, x2, y2
Note: For FORTRAN users, the INTEGER*2 version, the SBOXS 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.
All of the foregoing functions are essentially the same except for the type declarations of the parameters.
The sbox subroutine draws a two-dimensional, screen-aligned rectangle using the current color, writemask, linestyle, and linestyle repeat. Only these attributes, not the normal line attributes, are used. Most of the lighting/shading/viewing pipeline is bypassed.
The sides of the rectangle are parallel to the screen x and y axes. This rectangle cannot be rotated. The z coordinate is set to zero.
When you use the sbox subroutine, you must not use lighting, backfacing, depth-cueing, z-buffering, Gouraud shading, or alphablending.
This subroutine may be faster than the rect subroutine. It is useful for drawing a large number of rectangles that do not require rotating.
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 rectangle with the rect subroutine.
Drawing a filled screen-aligned rectangle with the sboxf subroutine.
AIX Graphics Library Overview, Setting Drawing Attributes, Drawing Rectangles, Circles, Arcs, and Polygons.