Introduction() — Silicon Graphics Beta Release
INTRODUCTION
The IRIS Reference Manual contains descriptions of the commands in the Graphics Library.
Each description defines the number, order, and types of the arguments to each command. C, FORTRAN, and Pascal descriptions are provided under the heading SPECIFICATION. A description of the command, including function, side effects, and potential errors is given in the section called DESCRIPTION; related commands are listed under SEE ALSO.
Some of the commands come in several versions, depending on the number and type of the arguments. Coordinate data can be 2D or 3D, and can be floating-point numbers, integers, or short (16-bit) integers. The default is 3D floating-point data. Integer data and 2D points are specified with suffixes: "i" for integer, "s" for short, and "2" for 2D.
An icon appears on each page to indicate whether the command can be compiled into a display list:
These commands can be used in
immediate mode or compiled
into a display list.
These commands can be used
only in immediate mode.
TEXT STRINGS
C and Pascal text strings are terminated with a null character (ASCII 0); FORTRAN has a character data type that includes the length of the string.
POINTERS
Many of the Graphics Library commands return several values to the caller. The arguments to these commands are pointers, or addresses of memory locations. In C, they are declared as pointer variables by prefixing the variable name with an asterisk in the declaration. FORTRAN passes all parameters by reference, so no special declaration is necessary. Pascal uses the var keyword to distinguish between value parameters and pointer arguments.
PASCAL ARRAYS
Pascal normally copies all arguments to a subroutine, including arrays. In the interest of efficiency, we have declared all array arguments to be reference parameters: an address to the data will be passed to the subroutine, rather than the data itself.
Furthermore, the Pascal language forces the size of the array to be part of the type of the array. Many Graphics Library commands accept variable-length arrays. Therefore, we have defined oversized arrays with MAXARRAY entries. The user can use some part of the array, or redefine MAXARRAY to a more realistic value.
BOOLEANS
Many of the commands have boolean arguments or return boolean values. These are declared as type Boolean in C and Pascal, and as logical or integer in FORTRAN. We assume that FALSE is zero, and that TRUE is anything except FALSE.
TYPE DECLARATIONS
We have constructed type declarations for C and Pascal wherever they add to the readability of the code. Here are the type definitions:
C
#define FALSE 0
#define TRUE !FALSE
#define PATTERN_16 16
#define PATTERN_32 32
#define PATTERN_64 64
#define PATTERN_16_SIZE 16
#define PATTERN_32_SIZE 64
#define PATTERN_64_SIZE 256
typedef unsigned char Byte;
typedef long Boolean;
typedef short Angle;
typedef short Scoord;
typedef short Screencoord;
typedef long Icoord;
typedef float Coord;
typedef char *String;
typedef float Matrix[4][4];
typedef unsigned short Device;
typedef unsigned short Colorindex;
typedef unsigned char RGBvalue;
typedef unsigned short Linestyle;
typedef unsigned short Cursor[16];
typedef struct {
unsigned short offset; /* 2 bytes */
Byte w,h;/* 2 bytes */
char xoff,yoff;/* 2 bytes */
short width;/* 2 bytes */
} Fontchar;
typedef long Object;
typedef long Tag;
typedef unsigned short Pattern16[PATTERN_16_SIZE];
typedef unsigned short Pattern32[PATTERN_32_SIZE];
typedef unsigned short Pattern64[PATTERN_64_SIZE];
Pascal
constMAXARRAY = 1023;
MAXRASTER = 4095;
MAXOBJECTS = 4095;
PATTERN_16 = 16;
PATTERN_32 = 32;
PATTERN_64 = 64;
PATTERN_16_SIZE = 16;
PATTERN_32_SIZE = 64;
PATTERN_64_SIZE = 256;
typeByte = 0..255;
Short = integer;
UnsignedShort = 0..65535;
Angle = integer;
Screencoord = short;
Icoord = longint;
Coord = real;
Scoord = UnsignedShort;
Strng = packed array [1..128] of char;
Matrix = array [0..3, 0..3] of real;
Device = UnsignedShort;
string128 = string [128];
pstring = ^Strng;
Colorindex = UnsignedShort;
RGBvalue = Byte;
Linestyle = UnsignedShort;
Pattern = array [0..15] of Byte;
Pattern16 = [0..PATTERN_16-SIZE] of UnsignedShort;
Pattern32 = [0..PATTERN_32_SIZE] of UnsignedShort;
Pattern64 = [0..PATTERN_64-SIZE] of UnsignedShort;
Cursor = array [0..15] of UnsignedShort;
Fontchar = record
offst: Short;
w, h: Byte;
xoff, yoff: -128..127;
width: Short;
end;
Object = longint;
Tag = longint;
Coord4array = array [0..MAXARRAY, 0..3] of Coord;
Coord3array = array [0..MAXARRAY, 0..2] of Coord;
Coord2array = array [0..MAXARRAY, 0..1] of Coord;
Icoord3array = array [0..MAXARRAY, 0..2] of Icoord;
Icoord2array = array [0..MAXARRAY, 0..1] of Icoord;
Scoord3array = array [0..MAXARRAY, 0..2] of Scoord;
Scoord2array = array [0..MAXARRAY, 0..1] of Scoord;
Screenarray = array [0..MAXARRAY, 0..2] of Screencoord;
Boolarray = array [0..MAXARRAY] of Boolean;
Colorarray = array [0..MAXARRAY] of Colorindex;
RGBarray = array [0..MAXARRAY] of RGBvalue;
Objarray = array [0..127] of Object;
Fntchrarray = array [0..127] of Fontchar;
Fontraster = array [0..MAXRASTER] of Short;
lbuffer = array [0..MAXOBJECTS] of Object;
Queuearray = array [0..MAXARRAY] of Short;
Curvearray = array [0..3] [0..2] of Coord;
Ibuffer = array [0..MAXARRAY] of Short;
Patcharray = array [0..3] [0..3] of Coord;
Version 2.3 — July 04, 1985