[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

defpattern Subroutine


Defines patterns used in area fills.


Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void defpattern
(Int32 index, Int16 size, Int16 *mask)


SUBROUTINE DEFPAT(index, size, mask)
INTEGER*4 index, size
INTEGER*2 mask((size*size)/16)
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.


The defpattern subroutine defines patterns for filling areas such as polygons, rectangles, and curves. By default, pattern 0 is a 16x16-bit solid pattern. Index 0 cannot be changed. The system stores the pattern in a pattern table at index.

The pattern is described from left to right and bottom to top, just as characters are described in a raster font. The defpattern subroutine allows you to define an arbitrary pattern and assign it an index identifier. You can later reference this pattern with the setpattern subroutine via this identifier. Patterns, cursors, and fonts are available to all windows when using multiple windows.

  1. The operation of this subroutine for the Supergraphics Processor Subsystem is modified. (See "Hardware Considerations".)
  2. This subroutine cannot be used to add to a display list.


index Specifies the constant to use as an identifier for the pattern described by the mask parameter. This constant is used as an index into a table of patterns.
mask Specifies the array of short integers that form the actual bit pattern.
size Specifies the size of the pattern: for example, 16 specifies a 16x16-bit pattern.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

On the High-Performance 3-D Graphics Processor, there is a performance penalty for non-solid patterns. The High-Performance 3-D Graphics Processor supports only 16x16-bit, 32x32-bit, or 64x64-bit patterns.

The POWER Gt4 and POWER Gt4x adapters support arbitrary-sized patterns, from 1x1 to 64x64 bits.

The Supergraphics Processor Subsystem and the POWER GXT1000 adapter support The Supergraphics Processor Subsystem supports only 16x16-bit and 32x32-bit patterns.The getgdesc(GD_MAX_PATTERN_SIZE) call can be used to determine the largest supported tile pattern.


/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.

Related Information

Defining a cursor with the defcursor subroutine.

Defining bitmaps for a raster font with the defrasterfont subroutine.

Returning the index of the current fill pattern with the getpattern subroutine.

Selecting a pattern for filling polygons and rectangles with the setpattern subroutine.

AIX Graphics Library Overview, Drawing Wire Frame Curves and Surface Patches, Drawing NURBS Curves and Surfaces, Drawing with Begin-End Style Subroutines, Drawing with Move-Draw Style Subroutines, Setting Drawing Attributes, Understanding the Hardware Used by GL, and Drawing Rectangles, Circles, Arcs, and Polygons.

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]