Chapter 5. OpenGL Reference Pages

This chapter contains the reference pages, in alphabetical order, for all the OpenGL commands. Each reference page may describe more than one related command, as shown in the following list of pages. The OpenGL Utility Library routines and those comprising the OpenGL extension to the X Window System are described in the following chapters

glAccum

NAME

glAccum - operate on the accumulation buffer

C SPECIFICATION

void glAccum( GLenum op, GLfloat value )

PARAMETERS

op

Specifies the accumulation buffer operation. Symbolic constants GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN are accepted.

value

Specifies a floating-point value used in the accumulation buffer operation. op determines how value is used.

DESCRIPTION

The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion blur, and depth of field can be created by accumulating images generated with different transformation matrices.

Each pixel in the accumulation buffer consists of red, green, blue, and alpha values. The number of bits per component in the accumulation buffer depends on the implementation. You can examine this number by calling glGetIntegerv four times, with arguments GL_ACCUM_RED_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS, respectively. Regardless of the number of bits per component, however, the range of values stored by each component is [-1, 1]. The accumulation buffer pixels are mapped one-to-one with frame buffer pixels.

glAccum operates on the accumulation buffer. The first argument, op, is a symbolic constant that selects an accumulation buffer operation. The second argument, value, is a floating-point value to be used in that operation. Five operations are specified: GL_ACCUM, GL_LOAD, GL_ADD, GL_MULT, and GL_RETURN.

All accumulation buffer operations are limited to the area of the current scissor box and are applied identically to the red, green, blue, and alpha components of each pixel. The contents of an accumulation buffer pixel component are undefined if the glAccum operation results in a value outside the range [-1,1]. The operations are as follows:

GL_ACCUM

Obtains R, G, B, and A values from the buffer currently selected for reading (see "glReadBuffer" .) Each component value is divided by 2n - 1, where n is the number of bits allocated to each color component in the currently selected buffer. The result is a floating-point value in the range [0,1], which is multiplied by value and added to the corresponding pixel component in the accumulation buffer, thereby updating the accumulation buffer.

GL_LOAD

Similar to GL_ACCUM, except that the current value in the accumulation buffer is not used in the calculation of the new value. That is, the R, G, B, and A values from the currently selected buffer are divided by 2n - 1, multiplied by value, and then stored in the corresponding accumulation buffer cell, overwriting the current value.

GL_ADD

Adds value to each R, G, B, and A in the accumulation buffer.

GL_MULT

Multiplies each R, G, B, and A in the accumulation buffer by value and returns the scaled component to its corresponding accumulation buffer location.

GL_RETURN

Transfers accumulation buffer values to the color buffer or buffers currently selected for writing. Each R, G, B, and A component is multiplied by value, then multiplied by 2n - 1, clamped to the range [0, 2n - 1 ], and stored in the corresponding display buffer cell. The only fragment operations that are applied to this transfer are pixel ownership, scissor, dithering, and color writemasks.

The accumulation buffer is cleared by specifying R, G, B, and A values to set it to with the glClearAccum directive, and issuing a glClear command with the accumulation buffer enabled.

NOTES

Only those pixels within the current scissor box are updated by any glAccum operation.

ERRORS

GL_INVALID_ENUM is generated if op is not an accepted value.

GL_INVALID_OPERATION is generated if there is no accumulation buffer.

GL_INVALID_OPERATION is generated if glAccum is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_ACCUM_RED_BITS
glGet with argument GL_ACCUM_GREEN_BITS
glGet with argument GL_ACCUM_BLUE_BITS
glGet with argument GL_ACCUM_ALPHA_BITS

glAlphaFunc

NAME

glAlphaFunc - specify the alpha test function

C SPECIFICATION

void glAlphaFunc( GLenum func, GLclampf ref )

PARAMETERS

func

Specifies the alpha comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The default function is GL_ALWAYS.

ref

Specifies the reference value that incoming alpha values are compared to. This value is clamped to the range 0 through 1, where 0 represents the lowest possible alpha value and 1 the highest possible value. The default reference is 0.

DESCRIPTION

The alpha test discards fragments depending on the outcome of a comparison between the incoming fragment's alpha value and a constant reference value. glAlphaFunc specifies the reference and comparison function. The comparison is performed only if alpha testing is enabled. (See "glEnable" and glDisable of GL_ALPHA_TEST.)

func and ref specify the conditions under which the pixel is drawn. The incoming alpha value is compared to ref using the function specified by func. If the comparison passes, the incoming fragment is drawn, conditional on subsequent stencil and depth buffer tests. If the comparison fails, no change is made to the frame buffer at that pixel location.

The comparison functions are as follows:

GL_NEVER

Never passes.

GL_LESS

Passes if the incoming alpha value is less than the reference value.

GL_EQUAL

Passes if the incoming alpha value is equal to the reference value.

GL_LEQUAL

Passes if the incoming alpha value is less than or equal to the reference value.

GL_GREATER


Passes if the incoming alpha value is greater than the reference value.

GL_NOTEQUAL


Passes if the incoming alpha value is not equal to the reference value.

GL_GEQUAL

Passes if the incoming alpha value is greater than or equal to the reference value.

GL_ALWAYS

Always passes.

glAlphaFunc operates on all pixel writes, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and from pixel draw and copy operations. glAlphaFunc does not affect screen clear operations.

NOTES

Alpha testing is done only in RGBA mode.

ERRORS

GL_INVALID_ENUM is generated if func is not an accepted value.

GL_INVALID_OPERATION is generated if glAlphaFunc is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_ALPHA_TEST_FUNC
glGet with argument GL_ALPHA_TEST_REF
glIsEnabled with argument GL_ALPHA_TEST

glBegin

NAME

glBegin, glEnd - delimit the vertices of a primitive or a group of like primitives

C SPECIFICATION

void glBegin( GLenum mode )

PARAMETERS

mode

Specifies the primitive or primitives that will be created from vertices presented between glBegin and the subsequent glEnd. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON.

C SPECIFICATION

void glEnd( void )

DESCRIPTION

glBegin and glEnd delimit the vertices that define a primitive or a group of like primitives. glBegin accepts a single argument that specifies which of ten ways the vertices are interpreted. Taking n as an integer count starting at one, and N as the total number of vertices specified, the interpretations are as follows:

GL_POINTS

Treats each vertex as a single point. Vertex n defines point n. N points are drawn.

GL_LINES

Treates each pair of vertices as an independent line segment. Vertices 2n-1 and 2n define line n. N/2 lines are drawn.

GL_LINE_STRIP


Draws a connected group of line segments from the first vertex to the last. Vertices n and n+1 define line n. N-1 lines drawn.

GL_LINE_LOOP


Draws a connected group of line segments from the first vertex to the last, then back to the first. Vertices n and n+1 define line n. The last line, however, is defined by vertices N and 1. N lines are drawn.

GL_TRIANGLES


Treates each triplet of vertices as an independent triangle. Vertices 3n-2, 3n-1, and 3n define triangle n. N/3 triangles are drawn.

GL_TRIANGLE_STRIP


Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n+1, and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle n. N-2 triangles are drawn.

GL_TRIANGLE_FAN


Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2 define triangle n. N-2 triangles are drawn.

GL_QUADS

Treats each group of four vertices as an independent quadrilateral. Vertices 4n-3, 4n-2, 4n-1, and 4n define quadrilateral n. N/4 quadrilaterals are drawn.

GL_QUAD_STRIP


Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2n-1, 2n, 2n+2, and 2n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data.

GL_POLYGON


Draws a single, convex polygon. Vertices 1 through N define this polygon.

Only a subset of GL commands can be used between glBegin and glEnd. The commands are glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, and glEdgeFlag. Also, it is acceptable to use glCallList or glCallLists to execute display lists that include only the preceding commands. If any other GL command is called between glBegin and glEnd, the error flag is set and the command is ignored.

Regardless of the value chosen for mode, there is no limit to the number of vertices that can be defined between glBegin and glEnd. Lines, triangles, quadrilaterals, and polygons that are incompletely specified are not drawn. Incomplete specification results when either too few vertices are provided to specify even a single primitive or when an incorrect multiple of vertices is specified. The incomplete primitive is ignored; the rest are drawn.

The minimum specification of vertices for each primitive is as follows: 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that require a certain multiple of vertices are GL_LINES (2), GL_TRIANGLES (3), GL_QUADS (4), and GL_QUAD_STRIP (2).

ERRORS

GL_INVALID_ENUM is generated if mode is set to an unaccepted value.

GL_INVALID_OPERATION is generated if a command other than glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, glEdgeFlag, glCallList, or glCallLists is called between glBegin and the corresponding glEnd.

GL_INVALID_OPERATION is generated if glEnd is called before the corresponding glBegin is called, or if glBegin is called within a glBegin/glEnd sequence.

glBitmap

NAME

glBitmap - draw a bitmap

C SPECIFICATION

void glBitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap )

PARAMETERS

width, height

Specify the pixel width and height of the bitmap image.

xorig, yorig

Specify the location of the origin in the bitmap image. The origin is measured from the lower left corner of the bitmap, with right and up being the positive axes.

xmove, ymove

Specify the x and y offsets to be added to the current raster position after the bitmap is drawn.

bitmap

Specifies the address of the bitmap image.

DESCRIPTION

A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to ones in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to zeros in the bitmap are not modified.

glBitmap takes seven arguments. The first pair specify the width and height of the bitmap image. The second pair specify the location of the bitmap origin relative to the lower left corner of the bitmap image. The third pair of arguments specify x and y offsets to be added to the current raster position after the bitmap has been drawn. The final argument is a pointer to the bitmap image itself.

The bitmap image is interpreted like image data for the glDrawPixels command, with width and height corresponding to the width and height arguments of that command, and with type set to GL_BITMAP and format set to GL_COLOR_INDEX. Modes specified using glPixelStore affect the interpretation of bitmap image data; modes specified using glPixelTransfer do not.

If the current raster position is invalid, glBitmap is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the window coordinates

where ( xr , yr ) is the raster position and ( xo , yo ) is the bitmap origin. Fragments are then generated for each pixel corresponding to a one in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index, and current raster texture coordinates. They are then treated just as if they had been generated by a point, line, or polygon, including texture mapping, fogging, and all per-fragment operations such as alpha and depth testing.

After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xmove and ymove. No change is made to the z coordinate of the current raster position, or to the current raster color, index, or texture coordinates.

ERRORS

GL_INVALID_VALUE is generated if width or height is negative.

GL_INVALID_OPERATION is generated if glBitmap is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_COLOR
glGet with argument GL_CURRENT_RASTER_INDEX
glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS
glGet with argument GL_CURRENT_RASTER_POSITION_VALID

glBlendFunc

NAME

glBlendFunc - specify pixel arithmetic

C SPECIFICATION

void glBlendFunc( GLenum sfactor, GLenum dfactor )

PARAMETERS

sfactor

Specifies how the red, green, blue, and alpha source-blending factors are computed. Nine symbolic constants are accepted: GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE.

dfactor

Specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and GL_ONE_MINUS_DST_ALPHA.

DESCRIPTION

In RGB mode, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). By default, blending is disabled. Use glEnable and glDisable with argument GL_BLEND to enable and disable blending.

glBlendFunc defines the operation of blending when it is enabled. sfactor specifies which of nine methods is used to scale the source color components. dfactor specifies which of eight methods is used to scale the destination color components. The eleven possible methods are described in the table below. Each method defines four scale factors, one each for red, green, blue, and alpha.

In the table and in subsequent equations, source and destination color components are referred to as (Rs , Gs , Bs , As ) and (Rd , Gd , Bd , Ad ). They are understood to have integer values between zero and (kR , kG , kB , kA ), where

and (mR , mG , mB , mA ) is the number of red, green, blue, and alpha bitplanes.

Source and destination scale factors are referred to as (sR , sG , sB , sA ) and (dR , dG , dB , dA ). The scale factors described in the table, denoted (fR , fG , fB , fA ), represent either source or destination factors. All scale factors have range [0,1].

parameter

(f R , f G , f B , f A )

GL_ZERO

(0, 0, 0, 0 )

GL_ONE

(1, 1, 1, 1 )

GL_SRC_COLOR

(R s / k R , G s / k G , B s / k B , A s / k A )

GL_ONE_MINUS_SRC_COLOR

(1, 1, 1, 1 ) - (R s / k R , G s / k G , B s / k B , A s / k A )

GL_DST_COLOR

(R d / k R , G d / k G , B d / k B , A d / k A )

GL_ONE_MINUS_DST_COLOR

(1, 1, 1, 1 ) - (R d / k R , G d / k G , B d / k B , A d / k A )

GL_SRC_ALPHA

(A s / k A , A s / k A , A s / k A , A s / k A )

GL_ONE_MINUS_SRC_ALPHA

(1, 1, 1, 1 ) - (A s / k A , A s / k A , A s / k A , A s / k A )

GL_DST_ALPHA

(A d / k A , A d / k A , A d / k A , A d / k A )

GL_ONE_MINUS_DST_ALPHA

(1, 1, 1, 1 ) - (A d / k A , A d / k A , A d / k A , A d / k A )

GL_SRC_ALPHA_SATURATE

(i, i, i, 1 )

In the table,

i = min (As , kA - Ad ) / kA

To determine the blended RGBA values of a pixel when drawing in RGB mode, the system uses the following equations:

Rd = min ( kR , Rs sR + Rd dR )
G
d = min ( kG , Gs sG + Gd dG )
B
d = min ( kB , Bs sB + Bd dB )
A
d = min ( kA , As sA + Ad dA )

Despite the apparent precision of the above equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to one is guaranteed not to modify its multiplicand, and a blend factor equal to zero reduces its multiplicand to zero. Thus, for example, when sfactor is GL_SRC_ALPHA, dfactor is GL_ONE_MINUS_SRC_ALPHA, and As is equal to kA, the equations reduce to simple replacement:

Rd = Rs
Gd = Gs
Bd = Bs
Ad = As

EXAMPLES

Transparency is best implemented using blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bitplanes in the frame buffer.

Blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is also useful for rendering antialiased points and lines in arbitrary order.

Polygon antialiasing is optimized using blend function (GL_SRC_ALPHA_SATURATE, GL_ONE) with polygons sorted from nearest to farthest. (See the "glEnable" , glDisable reference page and the GL_POLYGON_SMOOTH argument for information on polygon antialiasing.) Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage.

NOTES

Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (KA), representing complete opacity, to 0.0 (0), representing completely transparency.

When more than one color buffer is enabled for drawing, blending is done separately for each enabled buffer, using for destination color the contents of that buffer. (See "glDrawBuffer" .)

Blending affects only RGB rendering. It is ignored by color index renderers.

ERRORS

GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value.

GL_INVALID_OPERATION is generated if glBlendFunc is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_BLEND_SRC
glGet with argument GL_BLEND_DST
glIsEnabled with argument GL_BLEND

glCallList

NAME

glCallList - execute a display list

C SPECIFICATION

void glCallList( GLuint list )

PARAMETERS

list

Specifies the integer name of the display list to be executed.

DESCRIPTION

glCallList causes the named display list to be executed. The commands saved in the display list are executed in order, just as if they were called without using a display list. If list has not been defined as a display list, glCallList is ignored.

glCallList can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit is at least 64, and it depends on the implementation.

GL state is not saved and restored across a call to glCallList. Thus, changes made to GL state during the execution of a display list remain after execution of the display list is completed. Use glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix to preserve GL state across glCallList calls.

NOTES

Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval.

ASSOCIATED GETS

glGet with argument GL_MAX_LIST_NESTING
glIsList

glCallLists

NAME

glCallLists - execute a list of display lists

C SPECIFICATION

void glCallLists( GLsizei n, GLenum type, const GLvoid *lists )

PARAMETERS

n

Specifies the number of display lists to be executed.

type

Specifies the type of values in lists. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, and GL_4_BYTES are accepted.

lists

Specifies the address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of type.

DESCRIPTION

glCallLists causes each display list in the list of names passed as lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored.

glCallLists provides an efficient means for executing display lists. n allows lists with various name formats to be accepted. The formats are as follows:

GL_BYTE

lists is treated as an array of signed bytes, each in the range -128 through 127.

GL_UNSIGNED_BYTE


lists is treated as an array of unsigned bytes, each in the range 0 through 255.

GL_SHORT

lists is treated as an array of signed two-byte integers, each in the range -32768 through 32767.

GL_UNSIGNED_SHORT


lists is treated as an array of unsigned two-byte integers, each in the range 0 through 65535.

GL_INT

lists is treated as an array of signed four-byte integers.

GL_UNSIGNED_INT


lists is treated as an array of unsigned four-byte integers.

GL_FLOAT

lists is treated as an array of four-byte floating-point values.

GL_2_BYTES

lists is treated as an array of unsigned bytes. Each pair of bytes specifies a single display-list name. The value of the pair is computed as 256 times the unsigned value of the first byte plus the unsigned value of the second byte.

GL_3_BYTES

lists is treated as an array of unsigned bytes. Each triplet of bytes specifies a single display-list name. The value of the triplet is computed as 65536 times the unsigned value of the first byte, plus 256 times the unsigned value of the second byte, plus the unsigned value of the third byte.

GL_4_BYTES

lists is treated as an array of unsigned bytes. Each quadruplet of bytes specifies a single display-list name. The value of the quadruplet is computed as 16777216 times the unsigned value of the first byte, plus 65536 times the unsigned value of the second byte, plus 256 times the unsigned value of the third byte, plus the unsigned value of the fourth byte.

The list of display list names is not null-terminated. Rather, n specifies how many names are to be taken from lists.

An additional level of indirection is made available with the glListBase command, which specifies an unsigned offset that is added to each display-list name specified in lists before that display list is executed.

glCallLists can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, a limit is placed on the nesting level of display lists during display-list execution. This limit must be at least 64, and it depends on the implementation.

GL state is not saved and restored across a call to glCallLists. Thus, changes made to GL state during the execution of the display lists remain after execution is completed. Use glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix to preserve GL state across glCallLists calls.

NOTES

Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval.

ASSOCIATED GETS

glGet with argument GL_LIST_BASE
glGet with argument GL_MAX_LIST_NESTING
glIsList

glClear

NAME

glClear - clear buffers within the viewport

C SPECIFICATION

void glClear( GLbitfield mask )

PARAMETERS

mask

Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT.

DESCRIPTION

glClear sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer.

The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and z-buffering are ignored by glClear.

glClear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared.

The values are as follows:

GL_COLOR_BUFFER_BIT


Indicates the buffers currently enabled for color writing.

GL_DEPTH_BUFFER_BIT


Indicates the depth buffer.

GL_ACCUM_BUFFER_BIT


Indicates the accumulation buffer.

GL_STENCIL_BUFFER_BIT


Indicates the stencil buffer.

The value to which each buffer is cleared depends on the setting of the clear value for that buffer.

NOTES

If a buffer is not present, then a glClear directed at that buffer has no effect.

ERRORS

GL_INVALID_VALUE is generated if any bit other than the four defined bits is set in mask.

GL_INVALID_OPERATION is generated if glClear is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_ACCUM_CLEAR_VALUE
glGet with argument GL_DEPTH_CLEAR_VALUE
glGet with argument GL_INDEX_CLEAR_VALUE
glGet with argument GL_COLOR_CLEAR_VALUE
glGet with argument GL_STENCIL_CLEAR_VALUE

glClearAccum

NAME

glClearAccum - specify clear values for the accumulation buffer

C SPECIFICATION

void glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )

PARAMETERS

red, green, blue, alpha


Specify the red, green, blue, and alpha values used when the accumulation buffer is cleared. The default values are all zero.

DESCRIPTION

glClearAccum specifies the red, green, blue, and alpha values used by glClear to clear the accumulation buffer.

Values specified by glClearAccum are clamped to the range [-1,1].

ERRORS

GL_INVALID_OPERATION is generated if glClearAccum is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_ACCUM_CLEAR_VALUE

SEE ALSO

"glClear"

glClearColor

NAME

glClearColor - specify clear values for the color buffers

C SPECIFICATION

void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )

PARAMETERS

red, green, blue, alpha


Specify the red, green, blue, and alpha values used when the color buffers are cleared. The default values are all zero.

DESCRIPTION

glClearColor specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. Values specified by glClearColor are clamped to the range [0,1].

ERRORS

GL_INVALID_OPERATION is generated if glClearColor is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_COLOR_CLEAR_VALUE

SEE ALSO

"glClear"

glClearDepth

NAME

glClearDepth - specify the clear value for the depth buffer

C SPECIFICATION

void glClearDepth( GLclampd depth )

PARAMETERS

depth

Specifies the depth value used when the depth buffer is cleared.

DESCRIPTION

glClearDepth specifies the depth value used by glClear to clear the depth buffer. Values specified by glClearDepth are clamped to the range [0,1].

ERRORS

GL_INVALID_OPERATION is generated if glClearDepth is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_DEPTH_CLEAR_VALUE

SEE ALSO

"glClear"

glClearIndex

NAME

glClearIndex - specify the clear value for the color index buffers

C SPECIFICATION

void glClearIndex( GLfloat c )

PARAMETERS

c

Specifies the index used when the color index buffers are cleared. The default value is zero.

DESCRIPTION

glClearIndex specifies the index used by glClear to clear the color index buffers. c is not clamped. Rather, c is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2m -1, where m is the number of bits in a color index stored in the frame buffer.

ERRORS

GL_INVALID_OPERATION is generated if glClearIndex is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_INDEX_CLEAR_VALUE
glGet with argument GL_INDEX_BITS

SEE ALSO

"glClear"

glClearStencil

NAME

glClearStencil - specify the clear value for the stencil buffer

C SPECIFICATION

void glClearStencil( GLint s )

PARAMETERS

s

Specifies the index used when the stencil buffer is cleared. The default value is zero.

DESCRIPTION

glClearStencil specifies the index used by glClear to clear the stencil buffer. s is masked with 2m - 1, where m is the number of bits in the stencil buffer.

ERRORS

GL_INVALID_OPERATION is generated if glClearStencil is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_STENCIL_CLEAR_VALUE
glGet with argument GL_STENCIL_BITS

SEE ALSO

"glClear"

glClipPlane

NAME

glClipPlane - specify a plane against which all geometry is clipped

C SPECIFICATION

void glClipPlane( GLenum plane, const GLdouble *equation )

PARAMETERS

plane

Specifies which clipping plane is being positioned. Symbolic names of the form GL_CLIP_PLANEi, where i is an integer between 0 and GL_MAX_CLIP_PLANES -1, are accepted.

equation

Specifies the address of an array of four double-precision floating-point values. These values are interpreted as a plane equation.

DESCRIPTION

Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. glClipPlane allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axis, against which all geometry is clipped. Up to GL_MAX_CLIP_PLANES planes can be specified, where GL_MAX_CLIP_PLANES is at least six in all implementations. Because the resulting clipping region is the intersection of the defined half-spaces, it is always convex.

glClipPlane specifies a half-space using a four-component plane equation. When glClipPlane is called, equation is transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have no effect on the stored plane-equation components. If the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or zero, the vertex is in with respect to that clipping plane. Otherwise, it is out.

Clipping planes are enabled and disabled with glEnable and glDisable, and called with the argument GL_CLIP_PLANEi, where i is the plane number.

By default, all clipping planes are defined as (0,0,0,0) in eye coordinates and are disabled.

NOTES

It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i.

ERRORS

GL_INVALID_ENUM is generated if plane is not an accepted value.

GL_INVALID_OPERATION is generated if glClipPlane is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGetClipPlane
glIsEnabled with argument GL_CLIP_PLANEi

SEE ALSO

"glEnable"

glColor

NAME

glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, glColor4uiv, glColor4usv - set the current color

C SPECIFICATION

void glColor3b( GLbyte red, GLbyte green, GLbyte blue )
void glColor3d( GLdouble red, GLdouble green, GLdouble blue )
void glColor3f( GLfloat red, GLfloat green, GLfloat blue )
void glColor3i( GLint red, GLint green, GLint blue )
void glColor3s( GLshort red, GLshort green, GLshort blue )
void glColor3ub( GLubyte red, GLubyte green, GLubyte blue )
void glColor3ui( GLuint red, GLuint green, GLuint blue )
void glColor3us( GLushort red, GLushort green, GLushort blue )
void glColor4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha )
void glColor4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha )
void glColor4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
void glColor4i( GLint red, GLint green, GLint blue, GLint alpha )
void glColor4s( GLshort red, GLshort green, GLshort blue, GLshort alpha )
void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
void glColor4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha )
void glColor4us( GLushort red, GLushort green, GLushort blue, GLushort alpha )

PARAMETERS

red, green, blue

Specify new red, green, and blue values for the current color.

alpha

Specifies a new alpha value for the current color. Included only in the four-argument glColor4 command.

C SPECIFICATION

void glColor3bv( const GLbyte *v )
void glColor3dv( const GLdouble *v )
void glColor3fv( const GLfloat *v )
void glColor3iv( const GLint *v )
void glColor3sv( const GLshort *v )
void glColor3ubv( const GLubyte *v )
void glColor3uiv( const GLuint *v )
void glColor3usv( const GLushort *v )
void glColor4bv( const GLbyte *v )
void glColor4dv( const GLdouble *v )
void glColor4fv( const GLfloat *v )
void glColor4iv( const GLint *v )
void glColor4sv( const GLshort *v )
void glColor4ubv( const GLubyte *v )
void glColor4uiv( const GLuint *v )
void glColor4usv( const GLushort *v )

PARAMETERS

v

Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values.

DESCRIPTION

The GL stores both a current single-valued color index and a current four-valued RGBA color. glColor sets a new four-valued RGBA color. glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly, and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color components explicitly.

glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i take three or four unsigned byte, short, or long integers as arguments. When v is appended to the name, the color commands can take a pointer to an array of such values.

Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly.

Neither floating-point nor signed integer values are clamped to the range [0,1] before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer.

NOTES

The current color can be updated at any time. In particular, glColor can be called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_CURRENT_COLOR
glGet with argument GL_RGBA_MODE

SEE ALSO

"glIndex"

glColorMask

NAME

glColorMask - enable and disable writing of frame buffer color components

C SPECIFICATION

void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )

PARAMETERS

red, green, blue, alpha


Specify whether red, green, blue, and alpha can or cannot be written into the frame buffer. The default values are all GL_TRUE, indicating that the color components can be written.

DESCRIPTION

glColorMask specifies whether the individual color components in the frame buffer can or cannot be written. If red is GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted.

Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components.

ERRORS

GL_INVALID_OPERATION is generated if glColorMask is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_COLOR_WRITEMASK
glGet with argument GL_RGBA_MODE

glColorMaterial

NAME

glColorMaterial - cause a material color to track the current color

C SPECIFICATION

void glColorMaterial( GLenum face, GLenum mode )

PARAMETERS

face

Specifies whether front, back, or both front and back material parameters should track the current color. Accepted values are GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK. The default value is GL_FRONT_AND_BACK.

mode

Specifies which of several material parameters track the current color. Accepted values are GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, and GL_AMBIENT_AND_DIFFUSE. The default value is GL_AMBIENT_AND_DIFFUSE.

DESCRIPTION

glColorMaterial specifies which material parameters track the current color. When GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by mode, of the material or materials specified by face, track the current color at all times. GL_COLOR_MATERIAL is enabled and disabled using the commands glEnable and glDisable, called with GL_COLOR_MATERIAL as their argument. By default, it is disabled.

NOTES

glColorMaterial allows a subset of material parameters to be changed for each vertex using only the glColor command, without calling glMaterial. If only such a subset of parameters is to be specified for each vertex, glColorMaterial is preferred over calling glMaterial.

ERRORS

GL_INVALID_ENUM is generated if face or mode is not an accepted value.

GL_INVALID_OPERATION is generated if glColorMaterial is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glIsEnabled with argument GL_COLOR_MATERIAL
glGet with argument GL_COLOR_MATERIAL_PARAMETER
glGet with argument GL_COLOR_MATERIAL_FACE

glCopyPixels

NAME

glCopyPixels - copy pixels in the frame buffer

C SPECIFICATION

void glCopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type )

PARAMETERS

x, y

Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied.

width, height

Specify the dimensions of the rectangular region of pixels to be copied. Both must be nonnegative.

type

Specifies whether color values, depth values, or stencil values are to be copied. Symbolic constants GL_COLOR, GL_DEPTH, and GL_STENCIL are accepted.

DESCRIPTION

glCopyPixels copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware dependent and undefined.

x and y specify the window coordinates of the lower left corner of the rectangular region to be copied. width and height specify the dimensions of the rectangular region to be copied. Both width and height must not be negative.

Several parameters control the processing of the pixel data while it is being copied. These parameters are set with three commands: glPixelTransfer, glPixelMap, and glPixelZoom. This reference page describes the effects on glCopyPixels of most, but not all, of the parameters specified by these three commands.

glCopyPixels copies values from each pixel with the lower left-hand corner at (x + i, y + j) for 0≤i<width and 0≤j<height. This pixel is said to be the ith pixel in the jth row. Pixels are copied in row order from the lowest to the highest row, left to right in each row.

type specifies whether color, depth, or stencil data is to be copied. The details of the transfer for each data type are as follows:

GL_COLOR

Indices or RGBA colors are read from the buffer currently specified as the read source buffer (see "glReadBuffer" .) If the GL is in color index mode, each index that is read from this buffer is converted to a fixed-point format with an unspecified number of bits to the right of the binary point. Each index is then shifted left by GL_INDEX_SHIFT bits, and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result. If GL_MAP_COLOR is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_I_TO_I. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in a color index buffer.

If the GL is in RGBA mode, the red, green, blue, and alpha components of each pixel that is read are converted to an internal floating-point format with unspecified precision. The conversion maps the largest representable component value to 1.0, and component value zero to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively.

The resulting indices or RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning window coordinates (xr + i , yr + j), where (xr , yr) is the current raster position, and the pixel was the ith pixel in the jth row. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_DEPTH

Depth values are read from the depth buffer and converted directly to an internal floating-point format with unspecified precision. The resulting floating-point depth value is then multiplied by GL_DEPTH_SCALE and added to GL_DEPTH_BIAS. The result is clamped to the range [0,1].

The resulting depth components are then converted to fragments by attaching the current raster position color or color index and texture coordinates to each pixel, then assigning window coordinates (xr + i , yr + j), where (xr , yr) is the current raster position, and the pixel was the ith pixel in the jth row. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_STENCIL

Stencil indices are read from the stencil buffer and converted to an internal fixed-point format with an unspecified number of bits to the right of the binary point. Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits, and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result. If GL_MAP_STENCIL is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_S_TO_S. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in the stencil buffer. The resulting stencil indices are then written to the stencil buffer such that the index read from the ith location of the jth row is written to location (xr + i , yr + j), where (xr , yr) is the current raster position. Only the pixel ownership test, the scissor test, and the stencil writemask affect these writes.

The rasterization described thus far assumes pixel zoom factors of 1.0. If glPixelZoom is used to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If (xr, yr) is the current raster position, and a given pixel is in the ith location in the jth row of the source pixel rectangle, then fragments are generated for pixels whose centers are in the rectangle with corners at

(xr + zoomx i, yr + zoomy j)

and

(xr + zoomx (i + 1), yr + zoomy ( j + 1 ))

where zoomx is the value of GL_ZOOM_X and zoomy is the value of GL_ZOOM_Y.

EXAMPLES

To copy the color pixel in the lower left corner of the window to the current raster position, use

glCopyPixels(0, 0, 1, 1, GL_COLOR);

NOTES

Modes specified by glPixelStore have no effect on the operation of glCopyPixels.

ERRORS

GL_INVALID_ENUM is generated if type is not an accepted value.

GL_INVALID_VALUE is generated if either width or height is negative.

GL_INVALID_OPERATION is generated if type is GL_DEPTH and there is no depth buffer.

GL_INVALID_OPERATION is generated if type is GL_STENCIL and there is no stencil buffer.

GL_INVALID_OPERATION is generated if glCopyPixels is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_POSITION_VALID

glCullFace

NAME

glCullFace - specify whether front- or back-facing facets can be culled

C SPECIFICATION

void glCullFace( GLenum mode )

PARAMETERS

mode

Specifies whether front- or back-facing facets are candidates for culling. Symbolic constants GL_FRONT and GL_BACK are accepted. The default value is GL_BACK.

DESCRIPTION

glCullFace specifies whether front- or back-facing facets are culled (as specified by mode) when facet culling is enabled. Facet culling is enabled and disabled using the glEnable and glDisable commands with the argument GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles.

glFrontFace specifies which of the clockwise and counterclockwise facets are front-facing and back-facing. See "glFrontFace" .

ERRORS

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glCullFace is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glIsEnabled with argument GL_CULL_FACE
glGet with argument GL_CULL_FACE_MODE

glDeleteLists

NAME

glDeleteLists - delete a contiguous group of display lists

C SPECIFICATION

void glDeleteLists( GLuint list, GLsizei range )

PARAMETERS

list

Specifies the integer name of the first display list to delete.

range

Specifies the number of display lists to delete.

DESCRIPTION

glDeleteLists causes a contiguous group of display lists to be deleted. list is the name of the first display list to be deleted, and range is the number of display lists to delete. All display lists d with list dlist + range - 1 are deleted.

All storage locations allocated to the specified display lists are freed, and the names are available for reuse at a later time. Names within the range that do not have an associated display list are ignored. If range is zero, nothing happens.

ERRORS

GL_INVALID_VALUE is generated if range is negative.

GL_INVALID_OPERATION is generated if glDeleteLists is called between a call to glBegin and the corresponding call to glEnd.

glDepthFunc

NAME

glDepthFunc - specify the value used for depth buffer comparisons

C SPECIFICATION

void glDepthFunc( GLenum func )

PARAMETERS

func

Specifies the depth comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The default value is GL_LESS.

DESCRIPTION

glDepthFunc specifies the function used to compare each incoming pixel z value with the z value present in the depth buffer. The comparison is performed only if depth testing is enabled. (See "glEnable" and glDisable of GL_DEPTH_TEST.)

func specifies the conditions under which the pixel will be drawn. The comparison functions are as follows:

GL_NEVER

Never passes.

GL_LESS

Passes if the incoming z value is less than the stored z value.

GL_EQUAL

Passes if the incoming z value is equal to the stored z value.

GL_LEQUAL

Passes if the incoming z value is less than or equal to the stored z value.

GL_GREATER


Passes if the incoming z value is greater than the stored z value.

GL_NOTEQUAL


Passes if the incoming z value is not equal to the stored z value.

GL_GEQUAL

Passes if the incoming z value is greater than or equal to the stored z value.

GL_ALWAYS

Always passes.

The default value of func is GL_LESS. Initially, depth testing is disabled.

ERRORS

GL_INVALID_ENUM is generated if func is not an accepted value.

GL_INVALID_OPERATION is generated if glDepthFunc is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_DEPTH_FUNC
glIsEnabled with argument GL_DEPTH_TEST

glDepthMask

NAME

glDepthMask - enable or disable writing into the depth buffer

C SPECIFICATION

void glDepthMask( GLboolean flag )

PARAMETERS

flag

Specifies whether the depth buffer is enabled for writing. If flag is zero, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

DESCRIPTION

glDepthMask specifies whether the depth buffer is enabled for writing. If flag is zero, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

ERRORS

GL_INVALID_OPERATION is generated if glDepthMask is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_DEPTH_WRITEMASK

glDepthRange

NAME

glDepthRange - specify the mapping of z values from normalized device coordinates to window coordinates

C SPECIFICATION

void glDepthRange( GLclampd near, GLclampd far )

PARAMETERS

near

Specifies the mapping of the near clipping plane to window coordinates. The default value is 0.

far

Specifies the mapping of the far clipping plane to window coordinates. The default value is 1.

DESCRIPTION

After clipping and division by w, z coordinates range from -1.0 to 1.0, corresponding to the near and far clipping planes. glDepthRange specifies a linear mapping of the normalized z coordinates in this range to window z coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0.0 through 1.0 (like color components). Thus, the values accepted by glDepthRange are both clamped to this range before they are accepted.

The default mapping of 0,1 maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized.

NOTES

It is not necessary that near be less than far. Reverse mappings such as 1,0 are acceptable.

ERRORS

GL_INVALID_OPERATION is generated if glDepthRange is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_DEPTH_RANGE

glDrawBuffer

NAME

glDrawBuffer - specify which color buffers are to be drawn into

C SPECIFICATION

void glDrawBuffer( GLenum mode )

PARAMETERS

mode

Specifies up to four color buffers to be drawn into. Symbolic constants GL_NONE, GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, GL_FRONT_AND_BACK, and GL_AUXi, where i is between 0 and GL_AUX_BUFFERS -1, are accepted (GL_AUX_BUFFERS is not the upper limit; use glGet to query the number of available aux buffers.) The default value is GL_FRONT for single-buffered contexts, and GL_BACK for double-buffered contexts.

DESCRIPTION

When colors are written to the frame buffer, they are written into the color buffers specified by glDrawBuffer. The specifications are as follows:

GL_NONE

No color buffers are written.

GL_FRONT_LEFT


Only the front left color buffer is written.

GL_FRONT_RIGHT


Only the front right color buffer is written.

GL_BACK_LEFT


Only the back left color buffer is written.

GL_BACK_RIGHT


Only the back right color buffer is written.

GL_FRONT

Only the front left and front right color buffers are written. If there is no front right color buffer, only the front left color buffer is written.

GL_BACK

Only the back left and back right color buffers are written. If there is no back right color buffer, only the back left color buffer is written.

GL_LEFT

Only the front left and back left color buffers are written. If there is no back left color buffer, only the front left color buffer is written.

GL_RIGHT

Only the front right and back right color buffers are written. If there is no back right color buffer, only the front right color buffer is written.

GL_FRONT_AND_BACK


All the front and back color buffers (front left, front right, back left, back right) are written. If there are no back color buffers, only the front left and front right color buffers are written. If there are no right color buffers, only the front left and back left color buffers are written. If there are no right or back color buffers, only the front left color buffer is written.

GL_AUXi

Only auxiliary color buffer i is written.

If more than one color buffer is selected for drawing, then blending or logical operations are computed and applied independently for each color buffer and can produce different results in each buffer.

Monoscopic contexts include only left buffers, and stereoscopic contexts include both left and right buffers. Likewise, single-buffered contexts include only front buffers, and double-buffered contexts include both front and back buffers. The context is selected at GL initialization.

NOTES

It is always the case that GL_AUXi = GL_AUX0 + i.

ERRORS

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if none of the buffers indicated by mode exists.

GL_INVALID_OPERATION is generated if glDrawBuffer is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_DRAW_BUFFER
glGet with argument GL_AUX_BUFFERS

SEE ALSO

"glBlendFunc" , "glColorMask" , "glIndexMask" , "glLogicOp" , glReadSource

glDrawPixels

NAME

glDrawPixels - write a block of pixels to the frame buffer

C SPECIFICATION

void glDrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )

PARAMETERS

width, height

Specify the dimensions of the pixel rectangle that will be written into the frame buffer.

format

Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RGBA, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_LUMINANCE, and GL_LUMINANCE_ALPHA are accepted.

type

Specifies the data type for pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT are accepted.

pixels

Specifies a pointer to the pixel data.

DESCRIPTION

glDrawPixels reads pixel data from memory and writes it into the frame buffer relative to the current raster position. Use glRasterPos to set the current raster position, and use glGet with argument GL_CURRENT_RASTER_POSITION to query the raster position.

Several parameters define the encoding of pixel data in memory and control the processing of the pixel data before it is placed in the frame buffer. These parameters are set with four commands: glPixelStore, glPixelTransfer, glPixelMap, and glPixelZoom. This reference page describes the effects on glDrawPixels of many, but not all, of the parameters specified by these four commands.

Data is read from pixels as a sequence of signed or unsigned bytes, signed or unsigned shorts, signed or unsigned integers, or single-precision floating-point values, depending on type. Each of these bytes, shorts, integers, or floating-point values is interpreted as one color or depth component, or one index, depending on format. Indices are always treated individually. Color components are treated as groups of one, two, three, or four values, again based on format. Both individual indices and groups of components are referred to as pixels. If type is GL_BITMAP, the data must be unsigned bytes, and format must be either GL_COLOR_INDEX or GL_STENCIL_INDEX. Each unsigned byte is treated as eight 1-bit pixels, with bit ordering determined by GL_UNPACK_LSB_FIRST (see "glPixelStore" .)

widthxheight pixels are read from memory, starting at location pixels. By default, these pixels are taken from adjacent memory locations, except that after all width pixels are read, the read pointer is advanced to the next four-byte boundary. The four-byte row alignment is specified by glPixelStore with argument GL_UNPACK_ALIGNMENT, and it can be set to one, two, four, or eight bytes. Other pixel store parameters specify different read pointer advancements, both before the first pixel is read, and after all width pixels are read. Refer to the glPixelStore reference page for details on these options.

The widthxheight pixels that are read from memory are each operated on in the same way, based on the values of several parameters specified by glPixelTransfer and glPixelMap. The details of these operations, as well as the target buffer into which the pixels are drawn, are specific to the format of the pixels, as specified by format. format can assume one of eleven symbolic values:

GL_COLOR_INDEX


Each pixel is a single value, a color index. It is converted to fixed-point format, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to zero. Bitmap data convert to either 0.0 or 1.0.

Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result.

If the GL is in RGBA mode, the resulting index is converted to an RGBA pixel using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables. If the GL is in color index mode, and if GL_MAP_COLOR is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_I_TO_I. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in a color index buffer.

The resulting indices or RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

where (xr , yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_STENCIL_INDEX


Each pixel is a single value, a stencil index. It is converted to fixed-point format, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to zero. Bitmap data convert to either 0.0 or 1.0.

Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits, and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, zero bits fill otherwise unspecified bit locations in the result. If GL_MAP_STENCIL is true, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_S_TO_S. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in the stencil buffer. The resulting stencil indices are then written to the stencil buffer such that the nth index is written to location

where (xr , yr) is the current raster position. Only the pixel ownership test, the scissor test, and the stencil writemask affect these writes.

GL_DEPTH_COMPONENT


Each pixel is a single-depth component. Floating-point data is converted directly to an internal floating-point format with unspecified precision. Signed integer data is mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point depth value is then multiplied by GL_DEPTH_SCALE and added to GL_DEPTH_BIAS. The result is clamped to the range [0,1].

The resulting depth components are then converted to fragments by attaching the current raster position color or color index and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

where (xr , yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_RGBA

Each pixel is a four-component group: red first, followed by green, followed by blue, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1].

If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively.

The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that

where (xr , yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer.

GL_RED

Each pixel is a single red component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with green and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_GREEN

Each pixel is a single green component. This component is converted to the internal floating-point format in the same way as the green component of an RGBA pixel is, then it is converted to an RGBA pixel with red and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_BLUE

Each pixel is a single blue component. This component is converted to the internal floating-point format in the same way as the blue component of an RGBA pixel is, then it is converted to an RGBA pixel with red and green set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_ALPHA

Each pixel is a single alpha component. This component is converted to the internal floating-point format in the same way as the alpha component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to 0.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_RGB

Each pixel is a three-component group: red first, followed by green, followed by blue. Each component is converted to the internal floating-point format in the same way as the red, green, and blue components of an RGBA pixel are. The color triple is converted to an RGBA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_LUMINANCE


Each pixel is a single luminance component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

GL_LUMINANCE_ALPHA


Each pixel is a two-component group: luminance first, followed by alpha. The two components are converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then they are converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to the converted alpha value. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel.

The following table summarizes the meaning of the valid constants for the type parameter:

type

corresponding type

GL_UNSIGNED_BYTE

unsigned 8-bit integer

GL_BYTE

signed 8-bit integer

GL_BITMAP

single bits in unsigned 8-bit integers

GL_UNSIGNED_SHORT

unsigned 16-bit integer

GL_SHORT

signed 16-bit integer

GL_UNSIGNED_INT

unsigned 32-bit integer

GL_INT

32-bit integer

GL_FLOAT

single-precision floating-point

The rasterization described thus far assumes pixel zoom factors of 1.0. If glPixelZoom is used to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If (xr, yr) is the current raster position, and a given pixel is in the nth column and mth row of the pixel rectangle, then fragments are generated for pixels whose centers are in the rectangle with corners at

(xr + zoomx n, yr + zoomy m)

(xr + zoomx (n + 1), yr + zoomy ( m + 1 ))

where zoomx is the value of GL_ZOOM_X and zoomy is the value of GL_ZOOM_Y.

ERRORS

GL_INVALID_VALUE is generated if either width or height is negative.

GL_INVALID_ENUM is generated if format or type is not one of the accepted values.

GL_INVALID_OPERATION is generated if format is GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, or GL_LUMINANCE_ALPHA, and the GL is in color index mode.

GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not either GL_COLOR_INDEX or GL_STENCIL_INDEX.

GL_INVALID_OPERATION is generated if format is GL_STENCIL_INDEX and there is no stencil buffer.

GL_INVALID_OPERATION is generated if glDrawPixels is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_POSITION_VALID

glEdgeFlag

NAME

glEdgeFlag, glEdgeFlagv - flag edges as either boundary or nonboundary

C SPECIFICATION

void glEdgeFlag( GLboolean flag )

PARAMETERS

flag

Specifies the current edge flag value, either true or false.

C SPECIFICATION

void glEdgeFlagv( const GLboolean *flag )

PARAMETERS

flag

Specifies a pointer to an array that contains a single Boolean element, which replaces the current edge flag value.

DESCRIPTION

Each vertex of a polygon, separate triangle, or separate quadrilateral specified between a glBegin/glEnd pair is marked as the start of either a boundary or nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. glEdgeFlag sets the edge flag to true if flag is nonzero, false otherwise.

The vertices of connected triangles and connected quadrilaterals are always marked as boundary, regardless of the value of the edge flag.

Boundary and nonboundary edge flags on vertices are significant only if GL_POLYGON_MODE is set to GL_POINT or GL_LINE. See "glPolygonMode" .

Initially, the edge flag bit is true.

NOTES

The current edge flag can be updated at any time. In particular, glEdgeFlag can be called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_EDGE_FLAG

glEnable

NAME

glEnable, glDisable - enable or disable GL capabilities

C SPECIFICATION

void glEnable( GLenum cap )

PARAMETERS

cap

Specifies a symbolic constant indicating a GL capability.

C SPECIFICATION

void glDisable( GLenum cap )

PARAMETERS

cap

Specifies a symbolic constant indicating a GL capability.

DESCRIPTION

glEnable and glDisable enable and disable various capabilities. Use glIsEnabled or glGet to determine the current setting of any capability.

Both glEnable and glDisable take a single argument, cap, which can assume one of the following values:

GL_ALPHA_TEST


If enabled, do alpha testing. See "glAlphaFunc" .

GL_AUTO_NORMAL


If enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. See "glMap2" .

GL_BLEND

If enabled, blend the incoming RGBA color values with the values in the color buffers. See "glBlendFunc" .

GL_CLIP_PLANEi


If enabled, clip geometry against user-defined clipping plane i. See "glClipPlane" .

GL_COLOR_MATERIAL


If enabled, have one or more material parameters track the current color. See "glColorMaterial" .

GL_CULL_FACE


If enabled, cull polygons based on their winding in window coordinates. See "glCullFace" .

GL_DEPTH_TEST


If enabled, do depth comparisons and update the depth buffer. See "glDepthFunc" and "glDepthRange" .

GL_DITHER

If enabled, dither color components or indices before they are written to the color buffer.

GL_FOG

If enabled, blend a fog color into the posttexturing color. See "glFog" .

GL_LIGHTi

If enabled, include light i in the evaluation of the lighting equation. See "glLightModel" and "glLight" .

GL_LIGHTING


If enabled, use the current lighting parameters to compute the vertex color or index. Otherwise, simply associate the current color or index with each vertex. See "glMaterial" , "glLightModel" and "glLight" .

GL_LINE_SMOOTH


If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See "glLineWidth" .

GL_LINE_STIPPLE


If enabled, use the current line stipple pattern when drawing lines. See "glLineStipple" .

GL_LOGIC_OP


If enabled, apply the currently selected logical operation to the incoming and color buffer indices. See "glLogicOp" .

GL_MAP1_COLOR_4


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate RGBA values. See "glMap1" .

GL_MAP1_INDEX


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate color indices. See "glMap1" .

GL_MAP1_NORMAL


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate normals. See "glMap1" .

GL_MAP1_TEXTURE_COORD_1


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_2


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s and t texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_3


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, and r texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_4


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, r, and q texture coordinates. See "glMap1" .

GL_MAP1_VERTEX_3


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate will generate x, y, and z vertex coordinates. See "glMap1" .

GL_MAP1_VERTEX_4


If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate homogeneous x, y, z, and w vertex coordinates. See "glMap1" .

GL_MAP2_COLOR_4


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate RGBA values. See "glMap2" .

GL_MAP2_INDEX


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate color indices. See "glMap2" .

GL_MAP2_NORMAL


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate normals. See "glMap2" .

GL_MAP2_TEXTURE_COORD_1


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s texture coordinates. See "glMap2" .

GL_MAP2_TEXTURE_COORD_2


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s and t texture coordinates. See "glMap2"

GL_MAP2_TEXTURE_COORD_3


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, and r texture coordinates. See "glMap2" .

GL_MAP2_TEXTURE_COORD_4


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, r, and q texture coordinates. See "glMap2" .

GL_MAP2_VERTEX_3


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate will generate x, y, and z vertex coordinates. See "glMap2" .

GL_MAP2_VERTEX_4


If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate homogeneous x, y, z, and w vertex coordinates. See "glMap2" .

GL_NORMALIZE


If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. See "glNormal" .

GL_POINT_SMOOTH


If enabled, draw points with proper filtering. Otherwise, draw aliased points. See "glPointSize" .

GL_POLYGON_SMOOTH


If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. See "glPolygonMode" .

GL_POLYGON_STIPPLE


If enabled, use the current polygon stipple pattern when rendering polygons. See "glPolygonStipple" .

GL_SCISSOR_TEST


If enabled, discard fragments that are outside the scissor rectangle. See "glScissor" .

GL_STENCIL_TEST


If enabled, do stencil testing and update the stencil buffer. See "glStencilFunc" and "glStencilOp" .

GL_TEXTURE_1D


If enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). See "glTexImage1D" .

GL_TEXTURE_2D


If enabled, two-dimensional texturing is performed. See "glTexImage2D" .

GL_TEXTURE_GEN_Q


If enabled, the q texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current q texture coordinate is used. See "glTexGen" .

GL_TEXTURE_GEN_R


If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current r texture coordinate is used. See "glTexGen" .

GL_TEXTURE_GEN_S


If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current s texture coordinate is used. See "glTexGen" .

GL_TEXTURE_GEN_T


If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current t texture coordinate is used. See "glTexGen" .

ERRORS

GL_INVALID_ENUM is generated if cap is not one of the values listed above.

GL_INVALID_OPERATION is generated if glEnable is called between a call to glBegin and the corresponding call to glEnd.

glEvalCoord

NAME

glEvalCoord1d, glEvalCoord1f, glEvalCoord2d, glEvalCoord2f, glEvalCoord1dv, glEvalCoord1fv, glEvalCoord2dv, glEvalCoord2fv - evaluate enabled one- and two-dimensional maps

C SPECIFICATION

void glEvalCoord1d( GLdouble u )
void glEvalCoord1f( GLfloat u )
void glEvalCoord2d( GLdouble u, GLdouble v )
void glEvalCoord2f( GLfloat u, GLfloat v )

PARAMETERS

u

Specifies a value that is the domain coordinate u to the basis function defined in a previous glMap1 or glMap2 command.

v

Specifies a value that is the domain coordinate v to the basis function defined in a previous glMap2 command. This argument is not present in an glEvalCoord1 command.

C SPECIFICATION

void glEvalCoord1dv( const GLdouble *u )

void glEvalCoord1fv( const GLfloat *u )

void glEvalCoord2dv( const GLdouble *u )

void glEvalCoord2fv( const GLfloat *u )

PARAMETERS

u

Specifies a pointer to an array containing either one or two domain coordinates. The first coordinate is u. The second coordinate is v, which is present only in glEvalCoord2 versions.

DESCRIPTION

glEvalCoord1 evaluates enabled one-dimensional maps at argument u. glEvalCoord2 does the same for two-dimensional maps using two domain values, u and v. Maps are defined with glMap1 and glMap2 and enabled and disabled with glEnable and glDisable.

When one of the glEvalCoord commands is issued, all currently enabled maps of the indicated dimension are evaluated. Then, for each enabled map, it is as if the corresponding GL command was issued with the computed value. That is, if GL_MAP1_INDEX or GL_MAP2_INDEX is enabled, a glIndex command is simulated. If GL_MAP1_COLOR_4 or GL_MAP2_COLOR_4 is enabled, a glColor command is simulated. If GL_MAP1_NORMAL or GL_MAP2_NORMAL is enabled, a normal vector is produced, and if any of GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, or GL_MAP2_TEXTURE_COORD_4 is enabled, then an appropriate glTexCoord command is simulated.

The GL uses evaluated values instead of current values for those evaluations that are enabled, and current values otherwise, for color, color index, normal, and texture coordinates. However, the evaluated values do not update the current values. Thus, if glVertex commands are interspersed with glEvalCoord commands, the color, normal, and texture coordinates associated with the glVertex commands are not affected by the values generated by the glEvalCoord commands, but rather only by the most recent glColor, glIndex, glNormal, and glTexCoord commands.

No commands are issued for maps that are not enabled. If more than one texture evaluation is enabled for a particular dimension (for example, GL_MAP2_TEXTURE_COORD_1 and GL_MAP2_TEXTURE_COORD_2), then only the evaluation of the map that produces the larger number of coordinates (in this case, GL_MAP2_TEXTURE_COORD_2) is carried out. GL_MAP1_VERTEX_4 overrides GL_MAP1_VERTEX_3, and GL_MAP2_VERTEX_4 overrides GL_MAP2_VERTEX_3, in the same manner. If neither a three- nor four-component vertex map is enabled for the specified dimension, the glEvalCoord command is ignored.

If automatic normal generation is enabled, by calling glEnable with argument GL_AUTO_NORMAL, glEvalCoord2 generates surface normals analytically, regardless of the contents or enabling of the GL_MAP2_NORMAL map. Let

Then the generated normal n is

If automatic normal generation is disabled, the corresponding normal map GL_MAP2_NORMAL, if enabled, is used to produce a normal. If neither automatic normal generation nor a normal map is enabled, no normal is generated for glEvalCoord2 commands.

ASSOCIATED GETS

glIsEnabled with argument GL_MAP1_VERTEX_3
glIsEnabled
with argument GL_MAP1_VERTEX_4
glIsEnabled
with argument GL_MAP1_INDEX
glIsEnabled
with argument GL_MAP1_COLOR_4
glIsEnabled
with argument GL_MAP1_NORMAL
glIsEnabled
with argument GL_MAP1_TEXTURE_COORD_1
glIsEnabled
with argument GL_MAP1_TEXTURE_COORD_2
glIsEnabled
with argument GL_MAP1_TEXTURE_COORD_3
glIsEnabled
with argument GL_MAP1_TEXTURE_COORD_4
glIsEnabled
with argument GL_MAP2_VERTEX_3
glIsEnabled
with argument GL_MAP2_VERTEX_4
glIsEnabled
with argument GL_MAP2_INDEX
glIsEnabled
with argument GL_MAP2_COLOR_4
glIsEnabled
with argument GL_MAP2_NORMAL
glIsEnabled
with argument GL_MAP2_TEXTURE_COORD_1
glIsEnabled
with argument GL_MAP2_TEXTURE_COORD_2
glIsEnabled
with argument GL_MAP2_TEXTURE_COORD_3
glIsEnabled
with argument GL_MAP2_TEXTURE_COORD_4
glIsEnabled
with argument GL_AUTO_NORMAL
glGetMap

glEvalMesh

NAME

glEvalMesh1, glEvalMesh2 - compute a one- or two-dimensional grid of points or lines

C SPECIFICATION

void glEvalMesh1( GLenum mode, GLint i1, GLint i2 )

PARAMETERS

mode

In glEvalMesh1, specifies whether to compute a one-dimensional mesh of points or lines. Symbolic constants GL_POINT and GL_LINE are accepted.

i1, i2

Specify the first and last integer values for grid domain variable i.

C SPECIFICATION

void glEvalMesh2( GLenum mode, GLint i1, Lint i2, GLint j1, GLint j2 )

PARAMETERS

mode

In glEvalMesh2, specifies whether to compute a two-dimensional mesh of points, lines, or polygons. Symbolic constants GL_POINT, GL_LINE, and GL_FILL are accepted.

i1, i2

Specify the first and last integer values for grid domain variable i.

j1, j2

Specify the first and last integer values for grid domain variable j.

DESCRIPTION

glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalMesh steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified by glMap1 and glMap2. mode determines whether the resulting vertices are connected as points, lines, or filled polygons.

In the one-dimensional case, glEvalMesh1, the mesh is generated as if the following code fragment were executed:

glBegin(type);
for (i = i1; i  <= i2; i += 1) 
  glEvalCoord1(i ·Δu  +  u1)

glEnd();

where

Δu = (u2 - u1 ) / n

and n, u1, and u2 are the arguments to the most recent glMapGrid1 command. type is GL_POINTS if mode is GL_POINT, or GL_LINES if mode is GL_LINE. The one absolute numeric requirement is that if i = n, then the value computed from i ·Δu + u1 is exactly u2.

In the two-dimensional case, glEvalMesh2, let

Δu = (u2 - u1 )/n

Δv = (v2 - v1 )/m,

where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 command. Then, if mode is GL_FILL, the glEvalMesh2 command is equivalent to:

for (j = j1;  j  < j2; j += 1) {
    glBegin(GL_QUAD_STRIP);
    for (i = i1; i  <= i2; i += 1) {
        glEvalCoord2(i ·Δu  +  u1, j ·Δv  +  v1);
        glEvalCoord2(i ·Δu  +  u1, (j+1) ·Δv  +  v1);
    }
    glEnd();
}

If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to:

for (j = j1;  j  <= j2; j += 1) {
    glBegin(GL_LINE_STRIP);
    for (i = i1; i  <= i2; i += 1)
        glEvalCoord2(i ·Δu  +  u1, j ·Δv  +  v1);
    glEnd();
}
for (i = i1;  i  <= i2; i += 1) {
    glBegin(GL_LINE_STRIP);
    for (j = j1; j  <= j1; j += 1)

        glEvalCoord2(i ·Δu  +  u1, j ·Δv  +  v1);
    glEnd();
}

And finally, if mode is GL_POINT, then a call to glEvalMesh2 is equivalent to:

glBegin(GL_POINTS);
for (j = j1;  j  <= j2; j += 1) {
    for (i = i1; i  <= i2; i += 1) {
        glEvalCoord2(i ·Δu  +  u1, j ·Δv  +  v1);
    }
}

glEnd();

In all three cases, the only absolute numeric requirements are that if i = n, then the value computed from i ·Δu + u1 is exactly u2, and if j = m, then the value computed from j ·Δv + v1 is exactly v2.

ERRORS

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glEvalMesh is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_MAP1_GRID_DOMAIN
glGet with argument GL_MAP2_GRID_DOMAIN
glGet with argument GL_MAP1_GRID_SEGMENTS
glGet with argument GL_MAP2_GRID_SEGMENTS

glEvalPoint

NAME

glEvalPoint1, glEvalPoint2 - generate and evaluate a single point in a mesh

C SPECIFICATION

void glEvalPoint1( GLint i )
void glEvalPoint2( GLint i, GLint j )

PARAMETERS

i

Specifies the integer value for grid domain variable i.

j

Specifies the integer value for grid domain variable j (glEvalPoint2 only).

DESCRIPTION

glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalPoint can be used to evaluate a single grid point in the same gridspace that is traversed by glEvalMesh. Calling glEvalPoint1 is equivalent to calling

glEvalCoord1(i ·Δu  +  u1);

where

Δu = (u2 - u1 ) / n

and n, u1, and u2 are the arguments to the most recent glMapGrid1 command. The one absolute numeric requirement is that if i = n, then the value computed from i ·Δu + u1 is exactly u2.

In the two-dimensional case, glEvalPoint2, let

Δu = (u2 - u1 )/n

Δv = (v2 - v1 )/m

where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 command. Then the glEvalPoint2 command is equivalent to calling

glEvalCoord2(i ·Δu  +  u1, j ·Δv  +  v1);

The only absolute numeric requirements are that if i = n, then the value computed from i ·Δu + u1 is exactly u2, and if j = m, then the value computed from j ·Δv + v1 is exactly v2.

ASSOCIATED GETS

glGet with argument GL_MAP1_GRID_DOMAIN
glGet with argument GL_MAP2_GRID_DOMAIN
glGet with argument GL_MAP1_GRID_SEGMENTS
glGet with argument GL_MAP2_GRID_SEGMENTS

glFeedbackBuffer

NAME

glFeedbackBuffer - controls feedback mode

C SPECIFICATION

void glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )

PARAMETERS

size

Specifies the maximum number of values that can be written into buffer.

type

Specifies a symbolic constant that describes the information that will be returned for each vertex. GL_2D, GL_3D, GL_3D_COLOR, GL_3D_COLOR_TEXTURE, and GL_4D_COLOR_TEXTURE are accepted.

buffer

Returns the feedback data.

DESCRIPTION

The glFeedbackBuffer function controls feedback. Feedback, like selection, is a GL mode. The mode is selected by calling glRenderMode with GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL.

glFeedbackBuffer has three arguments: buffer is a pointer to an array of floating-point values into which feedback information is placed. size indicates the size of the array. type is a symbolic constant describing the information that is fed back for each vertex. glFeedbackBuffer must be issued before feedback mode is enabled (by calling glRenderMode with argument GL_FEEDBACK). Setting GL_FEEDBACK without establishing the feedback buffer, or calling glFeedbackBuffer while the GL is in feedback mode, is an error.

The GL is taken out of feedback mode by calling glRenderMode with a parameter value other than GL_FEEDBACK. When this is done while the GL is in feedback mode, glRenderMode returns the number of entries placed in the feedback array. The returned value never exceeds size. If the feedback data required more room than was available in buffer, glRenderMode returns a negative value.

While in feedback mode, each primitive that would be rasterized generates a block of values that get copied into the feedback array. If doing so would cause the number of entries to exceed the maximum, the block is partially written so as to fill the array (if there is any room left at all), and an overflow flag is set. Each block begins with a code indicating the primitive type, followed by values that describe the primitive's vertices and associated data. Entries are also written for bitmaps and pixel rectangles. Feedback occurs after polygon culling and glPolyMode interpretation of polygons has taken place, so polygons that are culled are not returned in the feedback buffer. It can also occur after polygons with more than three edges are broken up into triangles, if the GL implementation renders polygons by performing this decomposition.

The glPassThrough command can be used to insert a marker into the feedback buffer. See "glPassThrough" .

Following is the grammar for the blocks of values written into the feedback buffer. Each primitive is indicated with a unique identifying value followed by some number of vertices. Polygon entries include an integer value indicating how many vertices follow. A vertex is fed back as some number of floating-point values, as determined by type. Colors are fed back as four values in RGBA mode and one value in color index mode.

feedbackList <-- feedbackItem feedbackList | feedbackItem
feedbackItem <-- point | lineSegment | polygon | bitmap | pixelRectangle | passThru
point <-- GL_POINT_TOKEN vertex
lineSegment <-- GL_LINE_TOKEN vertex vertex | GL_LINE_RESET_TOKEN vertex vertex
polygon <-- GL_POLYGON_TOKEN n polySpec
polySpec <-- polySpec vertex | vertex vertex vertex
bitmap <-- GL_BITMAP_TOKEN vertex
pixelRectangle <-- GL_DRAW_PIXEL_TOKEN vertex | GL_COPY_PIXEL_TOKEN vertex
passThru <-- GL_PASS_THROUGH_TOKEN value
vertex <-- 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture
2d <-- value value
3d <-- value value value
3dColor <-- value value value color
3dColorTexture <-- value value value color tex
4dColorTexture <-- value value value value color tex
color <-- rgba | index
rgba <-- value value value value
index <-- value
tex <-- value value value value

value is a floating-point number, and n is a floating-point integer giving the number of vertices in the polygon. GL_POINT_TOKEN, GL_LINE_TOKEN, GL_LINE_RESET_TOKEN, GL_POLYGON_TOKEN, GL_BITMAP_TOKEN, GL_DRAW_PIXEL_TOKEN, GL_COPY_PIXEL_TOKEN and GL_PASS_THROUGH_TOKEN are symbolic floating-point constants. GL_LINE_RESET_TOKEN is returned whenever the line stipple pattern is reset. The data returned as a vertex depends on the feedback type.

The following table gives the correspondence between type and the number of values per vertex. k is 1 in color index mode and 4 in RGBA mode.

type

coordinates

color

texture

total number of values

GL_2D

x, y

2

GL_3D

x, y, z

3

GL_3D_COLO R

x, y, z

k

3 + k

GL_3D_COLO R_TEXTURE

x, y, z,

k

4

7 + k

GL_4D_COLO R_TEXTURE

x, y, z, w

k

4

8 + k

Feedback vertex coordinates are in window coordinates, except w, which is in clip coordinates. Feedback colors are lighted, if lighting is enabled. Feedback texture coordinates are generated, if texture coordinate generation is enabled. They are always transformed by the texture matrix.

NOTES

glFeedbackBuffer, when used in a display list, is not compiled into the display list but rather is executed immediately.

ERRORS

GL_INVALID_ENUM is generated if type is not an accepted value.

GL_INVALID_VALUE is generated if size is negative.

GL_INVALID_OPERATION is generated if glFeedbackBuffer is called while the render mode is GL_FEEDBACK, or if glRenderMode is called with argument GL_FEEDBACK before glFeedbackBuffer is called at least once.

GL_INVALID_OPERATION is generated if glFeedbackBuffer is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_RENDER_MODE

glFinish

NAME

glFinish - block until all GL execution is complete

C SPECIFICATION

void glFinish( void )

DESCRIPTION

glFinish does not return until the effects of all previously called GL commands are complete. Such effects include all changes to GL state, all changes to connection state, and all changes to the frame buffer contents.

NOTES

glFinish requires a round trip to the server.

ERRORS

GL_INVALID_OPERATION is generated if glFinish is called between a call to glBegin and the corresponding call to glEnd.

glFlush

NAME

glFlush - force execution of GL commands in finite time

C SPECIFICATION

void glFlush( void )

DESCRIPTION

Different GL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. glFlush empties all of these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in finite time.

Because any GL program might be executed over a network, or on an accelerator that buffers commands, all programs should call glFlush whenever they count on having all of their previously issued commands completed. For example, call glFlush before waiting for user input that depends on the generated image.

NOTES

glFlush can return at any time. It does not wait until the execution of all previously issued OpenGL commands is complete.

ERRORS

GL_INVALID_OPERATION is generated if glFlush is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glFinish"

glFog

NAME

glFogf, glFogi, glFogfv, glFogiv - specify fog parameters

C SPECIFICATION

void glFogf( GLenum pname, GLfloat param )

void glFogi( GLenum pname, GLint param )

PARAMETERS

pname

Specifies a single-valued fog parameter. GL_FOG_MODE, GL_FOG_DENSITY, GL_FOG_START, GL_FOG_END, and GL_FOG_INDEX are accepted.

param

Specifies the value that pname will be set to.

C SPECIFICATION

void glFogfv( GLenum pname, const GLfloat *params )

void glFogiv( GLenum pname, const GLint *params )

PARAMETERS

pname

Specifies a fog parameter. GL_FOG_MODE, GL_FOG_DENSITY, GL_FOG_START, GL_FOG_END, GL_FOG_INDEX, and GL_FOG_COLOR are accepted.

params

Specifies the value or values to be assigned to pname. GL_FOG_COLOR requires an array of four values. All other parameters accept an array containing only a single value.

DESCRIPTION

Fog is enabled and disabled with glEnable and glDisable using the argument GL_FOG. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations.

glFog assigns the value or values in params to the fog parameter specified by pname. The accepted values for pname are as follows:

GL_FOG_MODE


params is a single integer or floating-point value that specifies the equation to be used to compute the fog blend factor, f. Three symbolic constants are accepted: GL_LINEAR, GL_EXP, and GL_EXP2. The equations corresponding to these symbolic constants are defined below. The default fog mode is GL_EXP.

GL_FOG_DENSITY


params is a single integer or floating-point value that specifies density, the fog density used in both exponential fog equations. Only nonnegative densities are accepted. The default fog density is 1.0.

GL_FOG_START


params is a single integer or floating-point value that specifies start, the near distance used in the linear fog equation. The default near distance is 0.0.

GL_FOG_END


params is a single integer or floating-point value that specifies end, the far distance used in the linear fog equation. The default far distance is 1.0.

GL_FOG_INDEX


params is a single integer or floating-point value that specifies if, the fog color index. The default fog index is 0.0.

GL_FOG_COLOR


params contains four integer or floating-point values that specify Cf, the fog color. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. After conversion, all color components are clamped to the range [0,1]. The default fog color is (0,0,0,0).

Fog blends a fog color with each rasterized pixel fragment's posttexturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode. Let z be the distance in eye coordinates from the origin to the fragment being fogged. The equation for GL_LINEAR fog is

The equation for GL_EXP fog is

The equation for GL_EXP2 fog is

Regardless of the fog mode, f is clamped to the range [0,1] after it is computed. Then, if the GL is in RGBA color mode, the fragment's color Cr is replaced by

Cr'=fCr+(1-f)Cf

In color index mode, the fragment's color index ir is replaced by

ir'=ir+(1-f)if

ERRORS

GL_INVALID_ENUM is generated if pname is not an accepted value, or if pname is GL_FOG_MODE and params is not an accepted value.

GL_INVALID_VALUE is generated if pname is GL_FOG_DENSITY and params is negative.

GL_INVALID_OPERATION is generated if glFog is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glIsEnabled with argument GL_FOG
glGet with argument GL_FOG_COLOR
glGet with argument GL_FOG_INDEX
glGet with argument GL_FOG_DENSITY
glGet with argument GL_FOG_START
glGet with argument GL_FOG_END
glGet with argument GL_FOG_MODE

SEE ALSO

"glEnable"

glFrontFace

NAME

glFrontFace - define front- and back-facing polygons

C SPECIFICATION

void glFrontFace( GLenum mode )

PARAMETERS

mode

Specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted. The default value is GL_CCW.

DESCRIPTION

In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. Elimination of back-facing polygons is enabled and disabled with glEnable and glDisable using argument GL_CULL_FACE.

The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. glFrontFace specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing GL_CCW to mode selects counterclockwise polygons as front-facing; GL_CW selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing.

ERRORS

GL_INVALID_ENUM is generated if mode is not an accepted value.

GL_INVALID_OPERATION is generated if glFrontFace is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_FRONT_FACE

glFrustum

NAME

glFrustum - multiply the current matrix by a perspective matrix

C SPECIFICATION

void glFrustum( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far )

PARAMETERS

left, right

Specify the coordinates for the left and right vertical clipping planes.

bottom, top

Specify the coordinates for the bottom and top horizontal clipping planes.

near, far

Specify the distances to the near and far depth clipping planes. Both distances must be positive.

DESCRIPTION

glFrustum describes a perspective matrix that produces a perspective projection. (left, bottom, -near) and (right, top, -near) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, respectively, assuming that the eye is located at (0, 0, 0). -far specifies the location of the far clipping plane. Both near and far must be positive. The corresponding matrix is

The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and F is the frustum perspective matrix, then M is replaced with M o F.

Use glPushMatrix and glPopMatrix to save and restore the current matrix stack.

NOTES

Depth buffer precision is affected by the values specified for near and far. The greater the ratio of far to near is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If

roughly log2 r bits of depth buffer precision are lost. Because r approaches infinity as near approaches zero, near must never be set to zero.

ERRORS

GL_INVALID_VALUE is generated if near or far is not positive.

GL_INVALID_OPERATION is generated if glFrustum is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_MATRIX_MODE
glGet with argument GL_MODELVIEW_MATRIX
glGet with argument GL_PROJECTION_MATRIX
glGet with argument GL_TEXTURE_MATRIX

glGenLists

NAME

glGenLists - generate a contiguous set of empty display lists

C SPECIFICATION

GLuint glGenLists( GLsizei range )

PARAMETERS

range

Specifies the number of contiguous empty display lists to be generated.

DESCRIPTION

glGenLists has one argument, range. It returns an integer n such that range contiguous empty display lists, named n, n+1, ..., n+range -1, are created. If range is zero, if there is no group of range contiguous names available, or if any error is generated, no display lists are generated, and zero is returned.

ERRORS

GL_INVALID_VALUE is generated if range is negative.

GL_INVALID_OPERATION is generated if glGenLists is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glIsList

glGet

NAME

glGetBooleanv, glGetDoublev, glGetFloatv, glGetIntegerv - return the value or values of a selected parameter

C SPECIFICATION

void glGetBooleanv( GLenum pname, GLboolean *params )
void glGetDoublev( GLenum pname, GLdouble *params )
void glGetFloatv( GLenum pname, GLfloat *params )
void glGetIntegerv( GLenum pname, GLint *params )

PARAMETERS

pname

Specifies the parameter value to be returned. The symbolic constants in the list below are accepted.

params

Returns the value or values of the specified parameter.

DESCRIPTION

These four commands return values for simple state variables in GL. pname is a symbolic constant indicating the state variable to be returned, and params is a pointer to an array of the indicated type in which to place the returned data.

Type conversion is performed if params has a different type than the state variable value being requested. If glGetBooleanv is called, a floating-point or integer value is converted to GL_FALSE if and only if it is zero. Otherwise, it is converted to GL_TRUE. If glGetIntegerv is called, Boolean values are returned as GL_TRUE or GL_FALSE, and most floating-point values are rounded to the nearest integer value. Floating-point colors and normals, however, are returned with a linear mapping that maps 1.0 to the most positive representable integer value, and -1.0 to the most negative representable integer value. If glGetFloatv or glGetDoublev is called, Boolean values are returned as GL_TRUE or GL_FALSE, and integer values are converted to floating-point values.

The following symbolic constants are accepted by pname:

GL_ACCUM_ALPHA_BITS


params returns one value, the number of alpha bitplanes in the accumulation buffer.

GL_ACCUM_BLUE_BITS


params returns one value, the number of blue bitplanes in the accumulation buffer.

GL_ACCUM_CLEAR_VALUE


params returns four values: the red, green, blue, and alpha values used to clear the accumulation buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glClearAccum" .

GL_ACCUM_GREEN_BITS


params returns one value, the number of green bitplanes in the accumulation buffer.

GL_ACCUM_RED_BITS


params returns one value, the number of red bitplanes in the accumulation buffer.

GL_ALPHA_BIAS


params returns one value, the alpha bias factor used during pixel transfers. See "glPixelTransfer" .

GL_ALPHA_BITS


params returns one value, the number of alpha bitplanes in each color buffer.

GL_ALPHA_SCALE


params returns one value, the alpha scale factor used during pixel transfers. See "glPixelTransfer" .

GL_ALPHA_TEST


params returns a single Boolean value indicating whether alpha testing of fragments is enabled. See "glAlphaFunc" .

GL_ALPHA_TEST_FUNC


params returns one value, the symbolic name of the alpha test function. See "glAlphaFunc" .

GL_ALPHA_TEST_REF


params returns one value, the reference value for the alpha test. See "glAlphaFunc" . An integer value, if requested, is linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value.

GL_ATTRIB_STACK_DEPTH


params returns one value, the depth of the attribute stack. If the stack is empty, zero is returned. See "glPushAttrib" .

GL_AUTO_NORMAL


params returns a single Boolean value indicating whether 2-D map evaluation automatically generates surface normals. See "glMap2" .

GL_AUX_BUFFERS


params returns one value, the number of auxiliary color buffers.

GL_BLEND

params returns a single Boolean value indicating whether blending is enabled. See "glBlendFunc" .

GL_BLEND_DST


params returns one value, the symbolic constant identifying the destination blend function. See "glBlendFunc" .

GL_BLEND_SRC


params returns one value, the symbolic constant identifying the source blend function. See "glBlendFunc" .

GL_BLUE_BIAS


params returns one value, the blue bias factor used during pixel transfers. See "glPixelTransfer" .

GL_BLUE_BITS


params returns one value, the number of blue bitplanes in each color buffer.

GL_BLUE_SCALE


params returns one value, the blue scale factor used during pixel transfers. See "glPixelTransfer" .

GL_CLIP_PLANEi


params returns a single Boolean value indicating whether the specified clipping plane is enabled. See "glClipPlane" .

GL_COLOR_CLEAR_VALUE


params returns four values: the red, green, blue, and alpha values used to clear the color buffers. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glClearColor" .

GL_COLOR_MATERIAL


params returns a single Boolean value indicating whether one or more material parameters are tracking the current color. See "glColorMaterial" .

GL_COLOR_MATERIAL_FACE


params returns one value, a symbolic constant indicating which materials have a parameter that is tracking the current color. See "glColorMaterial"

GL_COLOR_MATERIAL_PARAMETER


params returns one value, a symbolic constant indicating which material parameters are tracking the current color. See "glColorMaterial" .

GL_COLOR_WRITEMASK


params returns four Boolean values: the red, green, blue, and alpha write enables for the color buffers. See "glColorMask" .

GL_CULL_FACE


params returns a single Boolean value indicating whether polygon culling is enabled. See "glCullFace" .

GL_CULL_FACE_MODE


params returns one value, a symbolic constant indicating which polygon faces are to be culled. See "glCullFace" .

GL_CURRENT_COLOR


params returns four values: the red, green, blue, and alpha values of the current color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glColor" .

GL_CURRENT_INDEX


params returns one value, the current color index. See "glIndex" .

GL_CURRENT_NORMAL


params returns three values: the x, y, and z values of the current normal. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glNormal" .

GL_CURRENT_RASTER_COLOR


params returns four values: the red, green, blue, and alpha values of the current raster position. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glRasterPos" .

GL_CURRENT_RASTER_DISTANCE


params returns one value, the distance from the eye to the current raster position. See "glRasterPos" .

GL_CURRENT_RASTER_INDEX


params returns one value, the color index of the current raster position. See "glRasterPos" .

GL_CURRENT_RASTER_POSITION


params returns four values: the x, y, z, and w components of the current raster position. x, y, and z are in window coordinates, and w is in clip coordinates. See "glRasterPos" .

GL_CURRENT_RASTER_TEXTURE_COORDS


params returns four values: the s, t, r, and q current raster texture coordinates. See "glRasterPos" and "glTexCoord" .

GL_CURRENT_RASTER_POSITION_VALID


params returns a single Boolean value indicating whether the current raster position is valid. See "glRasterPos" .

GL_CURRENT_TEXTURE_COORDS


params returns four values: the s, t, r, and q current texture coordinates. See "glTexCoord" .

GL_DEPTH_BIAS


params returns one value, the depth bias factor used during pixel transfers. See "glPixelTransfer" .

GL_DEPTH_BITS


params returns one value, the number of bitplanes in the depth buffer.

GL_DEPTH_CLEAR_VALUE


params returns one value, the value that is used to clear the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glClearDepth" .

GL_DEPTH_FUNC


params returns one value, the symbolic constant that indicates the depth comparison function. See "glDepthFunc" .

GL_DEPTH_RANGE


params returns two values: the near and far mapping limits for the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glDepthRange" .

GL_DEPTH_SCALE


params returns one value, the depth scale factor used during pixel transfers. See "glPixelTransfer" .

GL_DEPTH_TEST


params returns a single Boolean value indicating whether depth testing of fragments is enabled. See "glDepthFunc" and "glDepthRange" .

GL_DEPTH_WRITEMASK


params returns a single Boolean value indicating if the depth buffer is enabled for writing. See "glDepthMask" .

GL_DITHER


params returns a single Boolean value indicating whether dithering of fragment colors and indices is enabled.

GL_DOUBLEBUFFER


params returns a single Boolean value indicating whether double buffering is supported.

GL_DRAW_BUFFER


params returns one value, a symbolic constant indicating which buffers are being drawn to. See "glDrawBuffer" .

GL_EDGE_FLAG


params returns a single Boolean value indication whether the current edge flag is true or false. See "glEdgeFlag" .

GL_FOG

params returns a single Boolean value indicating whether fogging is enabled. See "glFog" .

GL_FOG_COLOR


params returns four values: the red, green, blue, and alpha components of the fog color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glFog" .

GL_FOG_DENSITY


params returns one value, the fog density parameter. See "glFog" .

GL_FOG_END


params returns one value, the end factor for the linear fog equation. See "glFog" .

GL_FOG_HINT


params returns one value, a symbolic constant indicating the mode of the fog hint. See "glHint" .

GL_FOG_INDEX


params returns one value, the fog color index. See "glFog" .

GL_FOG_MODE


params returns one value, a symbolic constant indicating which fog equation is selected. See "glFog" .

GL_FOG_START


params returns one value, the start factor for the linear fog equation. See "glFog" .

GL_FRONT_FACE


params returns one value, a symbolic constant indicating whether clockwise or counterclockwise polygon winding is treated as front-facing. See "glFrontFace" .

GL_GREEN_BIAS


params returns one value, the green bias factor used during pixel transfers.

GL_GREEN_BITS


params returns one value, the number of green bitplanes in each color buffer.

GL_GREEN_SCALE


params returns one value, the green scale factor used during pixel transfers. See "glPixelTransfer" .

GL_INDEX_BITS


params returns one value, the number of bitplanes in each color index buffer.

GL_INDEX_CLEAR_VALUE


params returns one value, the color index used to clear the color index buffers. See "glClearIndex" .

GL_INDEX_MODE


params returns a single Boolean value indicating whether the GL is in color index mode (true) or RGBA mode (false).

GL_INDEX_OFFSET


params returns one value, the offset added to color and stencil indices during pixel transfers. See "glPixelTransfer" .

GL_INDEX_SHIFT


params returns one value, the amount that color and stencil indices are shifted during pixel transfers. See "glPixelTransfer" .

GL_INDEX_WRITEMASK


params returns one value, a mask indicating which bitplanes of each color index buffer can be written. See "glIndexMask" .

GL_LIGHTi

params returns a single Boolean value indicating whether the specified light is enabled. See "glLight" and "glLightModel" .

GL_LIGHTING


params returns a single Boolean value indicating whether lighting is enabled. See "glLightModel" .

GL_LIGHT_MODEL_AMBIENT


params returns four values: the red, green, blue, and alpha components of the ambient intensity of the entire scene. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glLightModel" .

GL_LIGHT_MODEL_LOCAL_VIEWER


params returns a single Boolean value indicating whether specular reflection calculations treat the viewer as being local to the scene. See "glLightModel" .

GL_LIGHT_MODEL_TWO_SIDE


params returns a single Boolean value indicating whether separate materials are used to compute lighting for front- and back-facing polygons. See "glLightModel" .

GL_LINE_SMOOTH


params returns a single Boolean value indicating whether antialiasing of lines is enabled. See "glLineWidth" .

GL_LINE_SMOOTH_HINT


params returns one value, a symbolic constant indicating the mode of the line antialiasing hint. See "glHint" .

GL_LINE_STIPPLE


params returns a single Boolean value indicating whether stippling of lines is enabled. See "glLineStipple" .

GL_LINE_STIPPLE_PATTERN


params returns one value, the 16-bit line stipple pattern. See "glLineStipple" .

GL_LINE_STIPPLE_REPEAT


params returns one value, the line stipple repeat factor. See "glLineStipple" .

GL_LINE_WIDTH


params returns one value, the line width as specified with glLineWidth.

GL_LINE_WIDTH_GRANULARITY


params returns one value, the width difference between adjacent supported widths for antialiased lines. See "glLineWidth" .

GL_LINE_WIDTH_RANGE


params returns two values: the smallest and largest supported widths for antialiased lines. See "glLineWidth" .

GL_LIST_BASE


params returns one value, the base offset added to all names in arrays presented to glCallLists. See "glListBase" .

GL_LIST_INDEX


params returns one value, the name of the display list currently under construction. Zero is returned if no display list is currently under construction. See "glNewList" .

GL_LIST_MODE


params returns one value, a symbolic constant indicating the construction mode of the display list currently being constructed. See "glNewList" .

GL_LOGIC_OP


params returns a single Boolean value indicating whether fragment indexes are merged into the framebuffer using a logical operation. See "glLogicOp" .

GL_LOGIC_OP_MODE


params returns one value, a symbolic constant indicating the selected logic operational mode. See "glLogicOp" .

GL_MAP1_COLOR_4


params returns a single Boolean value indicating whether 1D evaluation generates colors. See "glMap1" .

GL_MAP1_GRID_DOMAIN


params returns two values: the endpoints of the 1-D map's grid domain. See "glMapGrid" .

GL_MAP1_GRID_SEGMENTS


params returns one value, the number of partitions in the 1-D map's grid domain. See "glMapGrid" .

GL_MAP1_INDEX


params returns a single Boolean value indicating whether 1D evaluation generates color indices. See "glMap1" .

GL_MAP1_NORMAL


params returns a single Boolean value indicating whether 1D evaluation generates normals. See "glMap1" .

GL_MAP1_TEXTURE_COORD_1


params returns a single Boolean value indicating whether 1D evaluation generates 1D texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_2


params returns a single Boolean value indicating whether 1D evaluation generates 2D texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_3


params returns a single Boolean value indicating whether 1D evaluation generates 3D texture coordinates. See "glMap1" .

GL_MAP1_TEXTURE_COORD_4


params returns a single Boolean value indicating whether 1D evaluation generates 4D texture coordinates. See "glMap1" .

GL_MAP1_VERTEX_3


params returns a single Boolean value indicating whether 1D evaluation generates 3D vertex coordinates. See "glMap1" .

GL_MAP1_VERTEX_4


params returns a single Boolean value indicating whether 1D evaluation generates 4D vertex coordinates. See "glMap1" .

GL_MAP2_COLOR_4


params returns a single Boolean value indicating whether 2D evaluation generates colors. See "glMap2" .

GL_MAP2_GRID_DOMAIN


params returns four values: the endpoints of the 2-D map's i and j grid domains. See "glMapGrid" .

GL_MAP2_GRID_SEGMENTS


params returns two values: the number of partitions in the 2-D map's i and j grid domains. See "glMapGrid" .

GL_MAP2_INDEX


params returns a single Boolean value indicating whether 2D evaluation generates color indices. See "glMap2" .

GL_MAP2_NORMAL


params returns a single Boolean value indicating whether 2D evaluation generates normals. See "glMap2" .

GL_MAP2_TEXTURE_COORD_1


params returns a single Boolean value indicating whether 2D evaluation generates 1D texture coordinates. See "glMap2" .

GL_MAP2_TEXTURE_COORD_2


params returns a single Boolean value indicating whether 2D evaluation generates 2D texture coordinates. See "glMap2" .

GL_MAP2_TEXTURE_COORD_3


params returns a single Boolean value indicating whether 2D evaluation generates 3D texture coordinates. See "glMap2" .

GL_MAP2_TEXTURE_COORD_4


params returns a single Boolean value indicating whether 2D evaluation generates 4D texture coordinates. See "glMap2" .

GL_MAP2_VERTEX_3


params returns a single Boolean value indicating whether 2D evaluation generates 3D vertex coordinates. See "glMap2" .

GL_MAP2_VERTEX_4


params returns a single Boolean value indicating whether 2D evaluation generates 4D vertex coordinates. See "glMap2" .

GL_MAP_COLOR


params returns a single Boolean value indicating if colors and color indices are to be replaced by table lookup during pixel transfers. See "glPixelTransfer" .

GL_MAP_STENCIL


params returns a single Boolean value indicating if stencil indices are to be replaced by table lookup during pixel transfers. See "glPixelTransfer" .

GL_MATRIX_MODE


params returns one value, a symbolic constant indicating which matrix stack is currently the target of all matrix operations. See "glMatrixMode" .

GL_MAX_ATTRIB_STACK_DEPTH


params returns one value, the maximum supported depth of the attribute stack. See "glPushAttrib" .

GL_MAX_CLIP_PLANES


params returns one value, the maximum number of application-defined clipping planes. See "glClipPlane" .

GL_MAX_EVAL_ORDER


params returns one value, the maximum equation order supported by 1-D and 2-D evaluators. See "glMap1" and "glMap2" .

GL_MAX_LIGHTS


params returns one value, the maximum number of lights. See "glLight" .

GL_MAX_LIST_NESTING


params returns one value, the maximum recursion depth allowed during display-list traversal. See "glCallList" .

GL_MAX_MODELVIEW_STACK_DEPTH


params returns one value, the maximum supported depth of the modelview matrix stack. See "glPushMatrix" .

GL_MAX_NAME_STACK_DEPTH


params returns one value, the maximum supported depth of the selection name stack. See "glPushName" .

GL_MAX_PIXEL_MAP_TABLE


params returns one value, the maximum supported size of a glPixelMap lookup table. See "glPixelMap" .

GL_MAX_PROJECTION_STACK_DEPTH


params returns one value, the maximum supported depth of the projection matrix stack. See "glPushMatrix" .

GL_MAX_TEXTURE_SIZE


params returns one value, the maximum width or height of any texture image (without borders). See "glTexImage1D" and "glTexImage2D" .

GL_MAX_TEXTURE_STACK_DEPTH


params returns one value, the maximum supported depth of the texture matrix stack. See "glPushMatrix" .

GL_MAX_VIEWPORT_DIMS


params returns two values: the maximum supported width and height of the viewport. See "glViewport" .

GL_MODELVIEW_MATRIX


params returns sixteen values: the modelview matrix on the top of the modelview matrix stack. See "glPushMatrix" .

GL_MODELVIEW_STACK_DEPTH


params returns one value, the number of matrices on the modelview matrix stack. See "glPushMatrix" .

GL_NAME_STACK_DEPTH


params returns one value, the number of names on the selection name stack. See "glPushMatrix" .

GL_NORMALIZE


params returns a single Boolean value indicating whether normals are automatically scaled to unit length after they have been transformed to eye coordinates. See "glNormal" .

GL_PACK_ALIGNMENT


params returns one value, the byte alignment used for writing pixel data to memory. See "glPixelStore" .

GL_PACK_LSB_FIRST


params returns a single Boolean value indicating whether single-bit pixels being written to memory are written first to the least significant bit of each unsigned byte. See "glPixelStore" .

GL_PACK_ROW_LENGTH


params returns one value, the row length used for writing pixel data to memory. See "glPixelStore" .

GL_PACK_SKIP_PIXELS


params returns one value, the number of pixel locations skipped before the first pixel is written into memory. See "glPixelStore" .

GL_PACK_SKIP_ROWS


params returns one value, the number of rows of pixel locations skipped before the first pixel is written into memory. See "glPixelStore" .

GL_PACK_SWAP_BYTES


params returns a single Boolean value indicating whether the bytes of two-byte and four-byte pixel indices and components are swapped before being written to memory. See "glPixelStore"

GL_PERSPECTIVE_CORRECTION_HINT


params returns one value, a symbolic constant indicating the mode of the perspective correction hint. See "glHint" .

GL_PIXEL_MAP_A_TO_A_SIZE


params returns one value, the size of the alpha-to-alpha pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_B_TO_B_SIZE


params returns one value, the size of the blue-to-blue pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_G_TO_G_SIZE


params returns one value, the size of the green-to-green pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_I_TO_A_SIZE


params returns one value, the size of the index-to-alpha pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_I_TO_B_SIZE


params returns one value, the size of the index-to-blue pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_I_TO_G_SIZE


params returns one value, the size of the index-to-green pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_I_TO_I_SIZE


params returns one value, the size of the index-to-index pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_I_TO_R_SIZE


params returns one value, the size of the index-to-red pixel translation table. See "glPixelMap"

GL_PIXEL_MAP_R_TO_R_SIZE


params returns one value, the size of the red-to-red pixel translation table. See "glPixelMap" .

GL_PIXEL_MAP_S_TO_S_SIZE


params returns one value, the size of the stencil-to-stencil pixel translation table. See "glPixelMap" .

GL_POINT_SIZE


params returns one value, the point size as specified by glPointSize.

GL_POINT_SIZE_GRANULARITY


params returns one value, the size difference between adjacent supported sizes for antialiased points. See "glPointSize" .

GL_POINT_SIZE_RANGE


params returns two values: the smallest and largest supported sizes for antialiased points. See "glPointSize" .

GL_POINT_SMOOTH


params returns a single Boolean value indicating whether antialiasing of points is enabled. See "glPointSize" .

GL_POINT_SMOOTH_HINT


params returns one value, a symbolic constant indicating the mode of the point antialiasing hint. See "glHint" .

GL_POLYGON_MODE


params returns two values: symbolic constants indicating whether front-facing and back-facing polygons are rasterized as points, lines, or filled polygons. See "glPolygonMode" .

GL_POLYGON_SMOOTH


params returns a single Boolean value indicating whether antialiasing of polygons is enabled. See "glPolygonMode" .

GL_POLYGON_SMOOTH_HINT


params returns one value, a symbolic constant indicating the mode of the polygon antialiasing hint. See "glHint" .

GL_POLYGON_STIPPLE


params returns a single Boolean value indicating whether stippling of polygons is enabled. See "glPolygonStipple" .

GL_PROJECTION_MATRIX


params returns sixteen values: the projection matrix on the top of the projection matrix stack. See "glPushMatrix" .

GL_PROJECTION_STACK_DEPTH


params returns one value, the number of matrices on the projection matrix stack. See "glPushMatrix" .

GL_READ_BUFFER


params returns one value, a symbolic constant indicating which color buffer is selected for reading. See "glReadPixels" and "glAccum" .

GL_RED_BIAS


params returns one value, the red bias factor used during pixel transfers.

GL_RED_BITS


params returns one value, the number of red bitplanes in each color buffer.

GL_RED_SCALE


params returns one value, the red scale factor used during pixel transfers. See "glPixelTransfer" .

GL_RENDER_MODE


params returns one value, a symbolic constant indicating whether the GL is in render, select, or feedback mode. See "glRenderMode" .

GL_RGBA_MODE


params returns a single Boolean value indicating whether the GL is in RGBA mode (true) or color index mode (false). See "glColor" .

GL_SCISSOR_BOX


params returns four values: the x and y window coordinates of the scissor box, follow by its width and height. See "glScissor" .

GL_SCISSOR_TEST


params returns a single Boolean value indicating whether scissoring is enabled. See "glScissor" .

GL_SHADE_MODEL


params returns one value, a symbolic constant indicating whether the shading mode is flat or smooth. See "glShadeModel" .

GL_STENCIL_BITS


params returns one value, the number of bitplanes in the stencil buffer.

GL_STENCIL_CLEAR_VALUE


params returns one value, the index to which the stencil bitplanes are cleared. See "glClearStencil" .

GL_STENCIL_FAIL


params returns one value, a symbolic constant indicating what action is taken when the stencil test fails. See "glStencilOp" .

GL_STENCIL_FUNC


params returns one value, a symbolic constant indicating what function is used to compare the stencil reference value with the stencil buffer value. See "glStencilFunc" .

GL_STENCIL_PASS_DEPTH_FAIL


params returns one value, a symbolic constant indicating what action is taken when the stencil test passes, but the depth test fails. See "glStencilOp" .

GL_STENCIL_PASS_DEPTH_PASS


params returns one value, a symbolic constant indicating what action is taken when the stencil test passes and the depth test passes. See "glStencilOp" .

GL_STENCIL_REF


params returns one value, the reference value that is compared with the contents of the stencil buffer. See "glStencilFunc" .

GL_STENCIL_TEST


params returns a single Boolean value indicating whether stencil testing of fragments is enabled. See "glStencilFunc" and "glStencilOp" .

GL_STENCIL_VALUE_MASK


params returns one value, the mask that is used to mask both the stencil reference value and the stencil buffer value before they are compared. See "glStencilFunc" .

GL_STENCIL_WRITEMASK


params returns one value, the mask that controls writing of the stencil bitplanes. See "glStencilMask" .

GL_STEREO


params returns a single Boolean value indicating whether stereo buffers (left and right) are supported.

GL_SUBPIXEL_BITS


params returns one value, an estimate of the number of bits of subpixel resolution that are used to position rasterized geometry in window coordinates.

GL_TEXTURE_1D


params returns a single Boolean value indicating whether 1D texture mapping is enabled. See "glTexImage1D" .

GL_TEXTURE_2D


params returns a single Boolean value indicating whether 2D texture mapping is enabled. See "glTexImage2D" .

GL_TEXTURE_ENV_COLOR


params returns four values: the red, green, blue, and alpha values of the texture environment color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. See "glTexEnv" .

GL_TEXTURE_ENV_MODE


params returns one value, a symbolic constant indicating what texture environment function is currently selected. See "glTexEnv" .

GL_TEXTURE_GEN_S


params returns a single Boolean value indicating whether automatic generation of the S texture coordinate is enabled. See "glTexGen" .

GL_TEXTURE_GEN_T


params returns a single Boolean value indicating whether automatic generation of the T texture coordinate is enabled. See "glTexGen" .

GL_TEXTURE_GEN_R


params returns a single Boolean value indicating whether automatic generation of the R texture coordinate is enabled. See "glTexGen" .

GL_TEXTURE_GEN_Q


params returns a single Boolean value indicating whether automatic generation of the Q texture coordinate is enabled. See "glTexGen" .

GL_TEXTURE_MATRIX


params returns sixteen values: the texture matrix on the top of the texture matrix stack. See "glPushMatrix" .

GL_TEXTURE_STACK_DEPTH


params returns one value, the number of matrices on the texture matrix stack. See "glPushMatrix" .

GL_UNPACK_ALIGNMENT


params returns one value, the byte alignment used for reading pixel data from memory. See "glPixelStore" .

GL_UNPACK_LSB_FIRST


params returns a single Boolean value indicating whether single-bit pixels being read from memory are read first from the least significant bit of each unsigned byte. See "glPixelStore" .

GL_UNPACK_ROW_LENGTH


params returns one value, the row length used for reading pixel data from memory. See "glPixelStore" .

GL_UNPACK_SKIP_PIXELS


params returns one value, the number of pixel locations skipped before the first pixel is read from memory. See "glPixelStore" .

GL_UNPACK_SKIP_ROWS


params returns one value, the number of rows of pixel locations skipped before the first pixel is read from memory. See "glPixelStore" .

GL_UNPACK_SWAP_BYTES


params returns a single Boolean value indicating whether the bytes of two-byte and four-byte pixel indices and components are swapped after being read from memory. See "glPixelStore" .

GL_VIEWPORT


params returns four values: the x and y window coordinates of the viewport, follow by its width and height. See "glViewport" .

GL_ZOOM_X


params returns one value, the x pixel zoom factor. See "glPixelZoom" .

GL_ZOOM_Y


params returns one value, the y pixel zoom factor. See "glPixelZoom" .

Many of the Boolean parameters can also be queried more easily using glIsEnabled.

ERRORS

GL_INVALID_ENUM is generated if pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGet is called between a call to glBegin and the corresponding call to glEnd.

glGetClipPlane

NAME

glGetClipPlane - return the coefficients of the specified clipping plane

C SPECIFICATION

void glGetClipPlane( GLenum plane, GLdouble *equation )

PARAMETERS

plane

Specifies a clipping plane. The number of clipping planes depends on the implementation, but at least six clipping planes are supported. They are identified by symbolic names of the form GL_CLIP_PLANEi where 0 ≤ i < GL_MAX_CLIP_PLANES.

equation

Returns four double-precision values that are the coefficients of the plane equation of plane in eye coordinates.

DESCRIPTION

glGetClipPlane returns in equation the four coefficients of the plane equation for plane.

NOTES

It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i.

If an error is generated, no change is made to the contents of equation.

ERRORS

GL_INVALID_ENUM is generated if plane is not an accepted value.

GL_INVALID_OPERATION is generated if glGetClipPlane is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glClipPlane"

glGetError

NAME

glGetError - return error information

C SPECIFICATION

GLenum glGetError( void )

DESCRIPTION

glGetError returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until glGetError is called, the error code is returned, and the flag is reset to GL_NO_ERROR. If a call to glGetError returns GL_NO_ERROR, there has been no detectable error since the last call to glGetError, or since the GL was initialized.

To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to GL_NO_ERROR when glGetError is called. If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value. Thus, glGetError should always be called in a loop, until it returns GL_NO_ERROR, if all error flags are to be reset.

Initially, all error flags are set to GL_NO_ERROR.

The currently defined errors are as follows:

GL_NO_ERROR


No error has been recorded. The value of this symbolic constant is guaranteed to be zero.

GL_INVALID_ENUM


An unacceptable value is specified for an enumerated argument. The offending command is ignored, having no side effect other than to set the error flag.

GL_INVALID_VALUE


A numeric argument is out of range. The offending command is ignored, having no side effect other than to set the error flag.

GL_INVALID_OPERATION


The specified operation is not allowed in the current state. The offending command is ignored, having no side effect other than to set the error flag.

GL_STACK_OVERFLOW


This command would cause a stack overflow. The offending command is ignored, having no side effect other than to set the error flag.

GL_STACK_UNDERFLOW


This command would cause a stack underflow. The offending command is ignored, having no side effect other than to set the error flag.

GL_OUT_OF_MEMORY


There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded.

When an error flag is set, results of a GL operation are undefined only if GL_OUT_OF_MEMORY has occurred. In all other cases, the command generating the error is ignored and has no effect on the GL state or frame buffer contents.

ERRORS

GL_INVALID_OPERATION is generated if glGetError is called between a call to glBegin and the corresponding call to glEnd.

glGetLight

NAME

glGetLightfv, glGetLightiv - return light source parameter values

C SPECIFICATION

void glGetLightfv( GLenum light, GLenum pname, GLfloat *params )
void glGetLightiv( GLenum light, GLenum pname, GLint *params )

PARAMETERS

light

Specifies a light source. The number of possible lights depends on the implementation, but at least eight lights are supported. They are identified by symbolic names of the form GL_LIGHTi where 0 ≤ i < GL_MAX_LIGHTS.

pname

Specifies a light source parameter for light. Accepted symbolic names are GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION , and GL_QUADRATIC_ATTENUATION.

params

Returns the requested data.

DESCRIPTION

glGetLight returns in params the value or values of a light source parameter. light names the light and is a symbolic name of the form GL_LIGHTi for 0≤i<GL_MAX_LIGHTS, where GL_MAX_LIGHTS is an implementation dependent constant that is greater than or equal to eight. pname specifies one of ten light source parameters, again by symbolic name.

The parameters are as follows:

GL_AMBIENT


params returns four integer or floating-point values representing the ambient intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_DIFFUSE


params returns four integer or floating-point values representing the diffuse intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_SPECULAR


params returns four integer or floating-point values representing the specular intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_POSITION


params returns four integer or floating-point values representing the position of the light source. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer value. The returned values are those maintained in eye coordinates. They will not be equal to the values specified using glLight, unless the modelview matrix was identity at the time glLight was called.

GL_SPOT_DIRECTION


params returns three integer or floating-point values representing the direction of the light source. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer value. The returned values are those maintained in eye coordinates. They will not be equal to the values specified using glLight, unless the modelview matrix was identity at the time glLight was called. Although spot direction is normalized before being used in the lighting equation, the returned values are the transformed versions of the specified values prior to normalization.

GL_SPOT_EXPONENT


params returns a single integer or floating-point value representing the spot exponent of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer.

GL_SPOT_CUTOFF


params returns a single integer or floating-point value representing the spot cutoff angle of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer.

GL_CONSTANT_ATTENUATION


params returns a single integer or floating-point value representing the constant (not distance related) attenuation of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer.

GL_LINEAR_ATTENUATION


params returns a single integer or floating-point value representing the linear attenuation of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer.

GL_QUADRATIC_ATTENUATION


params returns a single integer or floating-point value representing the quadratic attenuation of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer.

NOTES

It is always the case that GL_LIGHTi = GL_LIGHT0 + i.

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if light or pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGetLight is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glLight"

glGetMap

NAME

glGetMapdv, glGetMapfv, glGetMapiv - return evaluator parameters

C SPECIFICATION

void glGetMapdv( GLenum target, GLenum query, GLdouble *v )
void glGetMapfv( GLenum target, GLenum query, GLfloat *v )
void glGetMapiv( GLenum target, GLenum query, GLint *v )

PARAMETERS

target

Specifies the symbolic name of a map. Accepted values are GL_MAP1_COLOR_4, GL_MAP1_INDEX, GL_MAP1_NORMAL, GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, GL_MAP1_VERTEX_3, GL_MAP1_VERTEX_4, GL_MAP2_COLOR_4 , GL_MAP2_INDEX, GL_MAP2_NORMAL, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, GL_MAP2_TEXTURE_COORD_4, GL_MAP2_VERTEX_3, and GL_MAP2_VERTEX_4.

query

Specifies which parameter to return. Symbolic names GL_COEFF, GL_ORDER, and GL_DOMAIN are accepted.

v

Returns the requested data.

DESCRIPTION

glMap1 and glMap2 define evaluators. glGetMap returns evaluator parameters. target chooses a map, query selects a specific parameter, and v points to storage where the values will be returned.

The acceptable values for the target parameter are described in the glMap1 and glMap2 reference pages.

query can assume the following values:

GL_COEFF

v returns the control points for the evaluator function. One-dimensional evaluators return order control points, and two-dimensional evaluators return uorder ? vorder control points. Each control point consists of one, two, three, or four integer, single-precision floating-point, or double-precision floating-point values, depending on the type of the evaluator. Two-dimensional control points are returned in row-major order, incrementing the uorder index quickly, and the vorder index after each row. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values.

GL_ORDER

v returns the order of the evaluator function. One-dimensional evaluators return a single value, order. Two-dimensional evaluators return two values, uorder and vorder.

GL_DOMAIN


v returns the linear u and v mapping parameters. One-dimensional evaluators return two values, u1 and u2, as specified by glMap1. Two-dimensional evaluators return four values (u1, u2, v1, and v2) as specified by glMap2. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values.

NOTES

If an error is generated, no change is made to the contents of v.

ERRORS

GL_INVALID_ENUM is generated if either target or query is not an accepted value.

GL_INVALID_OPERATION is generated if glGetMap is called between a call to glBegin and the corresponding call to glEnd.

glGetMaterial

NAME

glGetMaterialfv, glGetMaterialiv - return material parameters

C SPECIFICATION

void glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
void glGetMaterialiv( GLenum face, GLenum pname, GLint *params )

PARAMETERS

face

Specifies which of the two materials is being queried. GL_FRONT or GL_BACK are accepted, representing the front and back materials, respectively.

pname

Specifies the material parameter to return. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, and GL_COLOR_INDEXES are accepted.

params

Returns the requested data.

DESCRIPTION

glGetMaterial returns in params the value or values of parameter pname of material face. Six parameters are defined:

GL_AMBIENT


params returns four integer or floating-point values representing the ambient reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_DIFFUSE


params returns four integer or floating-point values representing the diffuse reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_SPECULAR


params returns four integer or floating-point values representing the specular reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_EMISSION


params returns four integer or floating-point values representing the emitted light intensity of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined.

GL_SHININESS


params returns one integer or floating-point value representing the specular exponent of the material. Integer values, when requested, are computed by rounding the internal floating-point value to the nearest integer value.

GL_COLOR_INDEXES


params returns three integer or floating-point values representing the ambient, diffuse, and specular indices of the material. These indices are used only for color index lighting. (The other parameters are all used only for RGBA lighting.) Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values.

NOTES

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if face or pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGetMaterial is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glMaterial"

glGetPixelMap

NAME

glGetPixelMapfv, glGetPixelMapuiv, glGetPixelMapusv - return the specified pixel map

C SPECIFICATION

void glGetPixelMapfv( GLenum map, GLfloat *values )
void glGetPixelMapuiv( GLenum map, GLuint *values )
void glGetPixelMapusv( GLenum map, GLushort *values )

PARAMETERS

map

Specifies the name of the pixel map to return. Accepted values are GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, GL_PIXEL_MAP_I_TO_A, GL_PIXEL_MAP_R_TO_R, GL_PIXEL_MAP_G_TO_G, GL_PIXEL_MAP_B_TO_B, and GL_PIXEL_MAP_A_TO_A.

values

Returns the pixel map contents.

DESCRIPTION

Please see the "glPixelMap" reference page for a description of the acceptable values for the map parameter. glGetPixelMap returns in values the contents of the pixel map specified in map. Pixel maps are used during the execution of glReadPixels, glDrawPixels, glCopyPixels, glTexImage1D, and glTexImage2D to map color indices, stencil indices, color components, and depth components to other values.

Unsigned integer values, if requested, are linearly mapped from the internal fixed or floating-point representation such that 1.0 maps to the largest representable integer value, and 0.0 maps to zero. Return unsigned integer values are undefined if the map value was not in the range [0,1].

To determine the required size of map, call glGet with the appropriate symbolic constant.

NOTES

If an error is generated, no change is made to the contents of values.

ERRORS

GL_INVALID_ENUM is generated if map is not an accepted value.

GL_INVALID_OPERATION is generated if glGetPixelMap is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_PIXEL_MAP_I_TO_I_SIZE
glGet with argument GL_PIXEL_MAP_S_TO_S_SIZE
glGet with argument GL_PIXEL_MAP_I_TO_R_SIZE
glGet with argument GL_PIXEL_MAP_I_TO_G_SIZE
glGet with argument GL_PIXEL_MAP_I_TO_B_SIZE
glGet with argument GL_PIXEL_MAP_I_TO_A_SIZE
glGet with argument GL_PIXEL_MAP_R_TO_R_SIZE
glGet with argument GL_PIXEL_MAP_G_TO_G_SIZE
glGet with argument GL_PIXEL_MAP_B_TO_B_SIZE
glGet with argument GL_PIXEL_MAP_A_TO_A_SIZE
glGet with argument GL_MAX_PIXEL_MAP_TABLE

glGetPolygonStipple

NAME

glGetPolygonStipple - return the polygon stipple pattern

C SPECIFICATION

void glGetPolygonStipple( GLubyte *mask )

PARAMETERS

mask

Returns the stipple pattern.

DESCRIPTION

glGetPolygonStipple returns to mask a 32?32 polygon stipple pattern. The pattern is packed into memory as if glReadPixels with both height and width of 32, type of GL_BITMAP, and format of GL_COLOR_INDEX were called, and the stipple pattern were stored in an internal 32?32 color index buffer. Unlike glReadPixels, however, pixel transfer operations (shift, offset, pixel map) are not applied to the returned stipple image.

NOTES

If an error is generated, no change is made to the contents of mask.

ERRORS

GL_INVALID_OPERATION is generated if glGetPolygonStipple is called between a call to glBegin and the corresponding call to glEnd.

glGetString

NAME

glGetString - returns a string describing the current GL connection

C SPECIFICATION

const GLubyte * glGetString( GLenum name )

PARAMETERS

name

Specifies a symbolic constant, one of GL_VENDOR, GL_RENDERER, GL_VERSION, or GL_EXTENSIONS.

DESCRIPTION

glGetString returns a pointer to a static string describing some aspect of the current GL connection. name can be one of the following:

GL_VENDOR


Returns the company responsible for this GL implementation. This name does not change from release to release.

GL_RENDERER


Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release.

GL_VERSION


Returns a version or release number.

GL_EXTENSIONS


Returns a space-separated list of supported extensions to GL.

Because GL does not include queries for the performance characteristics of an implementation, it is expected that some applications will be written to recognize known platforms and will modify their GL usage based on known performance characteristics of these platforms. Strings GL_VENDOR and GL_RENDERER together uniquely specify a platform, and will not change from release to release. They should be used by such platform recognition algorithms.

The format and contents of the string that glGetString returns depend on the implementation, except that extension names will not include space characters and will be separated by space characters in the GL_EXTENSIONS string, and that all strings are null-terminated.

NOTES

If an error is generated, glGetString returns zero.

ERRORS

GL_INVALID_ENUM is generated if name is not an accepted value.

GL_INVALID_OPERATION is generated if glGetString is called between a call to glBegin and the corresponding call to glEnd.

glGetTexEnv

NAME

glGetTexEnvfv, glGetTexEnviv - return texture environment parameters

C SPECIFICATION

void glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
void glGetTexEnviv( GLenum target, GLenum pname, GLint *params )

PARAMETERS

target

Specifies a texture environment. Must be GL_TEXTURE_ENV.

pname

Specifies the symbolic name of a texture environment parameter. Accepted values are GL_TEXTURE_ENV_MODE and GL_TEXTURE_ENV_COLOR.

params

Returns the requested data.

DESCRIPTION

glGetTexEnv returns in params selected values of a texture environment that was specified with glTexEnv. target specifies a texture environment. Currently, only one texture environment is defined and supported: GL_TEXTURE_ENV.

pname names a specific texture environment parameter. The two parameters are as follows:

GL_TEXTURE_ENV_MODE


params returns the single-valued texture environment mode, a symbolic constant.

GL_TEXTURE_ENV_COLOR


params returns four integer or floating-point values that are the texture environment color. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer, and -1.0 maps to the most negative representable integer.

NOTES

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if target or pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGetTexEnv is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glTexEnv"

glGetTexGen

NAME

glGetTexGendv, glGetTexGenfv, glGetTexGeniv - return texture coordinate generation parameters

C SPECIFICATION

void glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params )
void glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params )
void glGetTexGeniv( GLenum coord, GLenum pname, GLint *params )

PARAMETERS

coord

Specifies a texture coordinate. Must be GL_S, GL_T, GL_R, or GL_Q.

pname

Specifies the symbolic name of the value(s) to be returned. Must be either GL_TEXTURE_GEN_MODE or the name of one of the texture generation plane equations: GL_OBJECT_PLANE or GL_EYE_PLANE.

params

Returns the requested data.

DESCRIPTION

glGetTexGen returns in params selected parameters of a texture coordinate generation function that was specified using glTexGen. coord names one of the (s ,t ,r ,q) texture coordinates, using the symbolic constant GL_S, GL_T, GL_R, or GL_Q.

pname specifies one of three symbolic names:

GL_TEXTURE_GEN_MODE


params returns the single-valued texture generation function, a symbolic constant.

GL_OBJECT_PLANE


params returns the four plane equation coefficients that specify object linear-coordinate generation. Integer values, when requested, are mapped directly from the internal floating-point representation.

GL_EYE_PLANE


params returns the four plane equation coefficients that specify eye linear-coordinate generation. Integer values, when requested, are mapped directly from the internal floating-point representation. The returned values are those maintained in eye coordinates. They are not equal to the values specified using glTexGen, unless the modelview matrix was identity at the time glTexGen was called.

NOTES

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if coord or pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGetTexGen is called between a call to glBegin and the corresponding call to glEnd.

SEE ALSO

"glTexGen"

glGetTexImage

NAME

glGetTexImage - return a texture image

C SPECIFICATION

void glGetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels )

PARAMETERS

target

Specifies which texture is to be obtained. GL_TEXTURE_1D and GL_TEXTURE_2D are accepted.

level

Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the nth mipmap reduction image.

format

Specifies a pixel format for the returned data. The supported formats are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA.

type

Specifies a pixel type for the returned data. The supported types are GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT.

pixels

Returns the texture image. Should be a pointer to an array of the type specified by type.

DESCRIPTION

glGetTexImage returns a texture image into pixels. target specifies whether the desired texture image is one specified by glTexImage1D (GL_TEXTURE_1D) or by glTexImage2D (GL_TEXTURE_2D). level specifies the level-of-detail number of the desired image. format and type specify the format and type of the desired image array. Please see the reference pages "glTexImage1D" and "glDrawPixels" for a description of the acceptable values for the format and type parameters, respectively.

Operation of glGetTexImage is best understood by considering the selected internal four-component texture image to be an RGBA color buffer the size of the image. The semantics of glGetTexImage are then identical to those of glReadPixels called with the same format and type, with x and y set to zero, width set to the width of the texture image (including border if one was specified), and height set to one for 1-D images, or to the height of the texture image (including border if one was specified) for 2-D images. Because the internal texture image is an RGBA image, pixel formats GL_COLOR_INDEX, GL_STENCIL_INDEX, and GL_DEPTH_COMPONENT are not accepted, and pixel type GL_BITMAP is not accepted.

If the selected texture image does not contain four components, the following mappings are applied. Single-component textures are treated as RGBA buffers with red set to the single-component value, and green, blue, and alpha set to zero. Two-component textures are treated as RGBA buffers with red set to the value of component zero, alpha set to the value of component one, and green and blue set to zero. Finally, three-component textures are treated as RGBA buffers with red set to component zero, green set to component one, blue set to component two, and alpha set to zero.

To determine the required size of pixels, use glGetTexLevelParameter to ascertain the dimensions of the internal texture image, then scale the required number of pixels by the storage required for each pixel, based on format and type. Be sure to take the pixel storage parameters into account, especially GL_PACK_ALIGNMENT.

NOTES

If an error is generated, no change is made to the contents of pixels.

ERRORS

GL_INVALID_ENUM is generated if target, format, or type is not an accepted value.

GL_INVALID_VALUE is generated if level is less than zero or greater than log2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.

GL_INVALID_OPERATION is generated if glGetTexImage is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGetTexLevelParameter with argument GL_TEXTURE_WIDTH
glGetTexLevelParameter
with argument GL_TEXTURE_HEIGHT
glGetTexLevelParameter
with argument GL_TEXTURE_BORDER
glGetTexLevelParameter
with argument GL_TEXTURE_COMPONENTS
glGet
with arguments GL_PACK_ALIGNMENT and others

glGetTexLevelParameter

NAME

glGetTexLevelParameterfv, glGetTexLevelParameteriv - return texture parameter values for a specific level of detail

C SPECIFICATION

void glGetTexLevelParameterfv( GLenum target, GLint level, GLenum pname, GLfloat *params )

void glGetTexLevelParameteriv( GLenum target, GLint level, GLenum pname, GLint *params )

PARAMETERS

target

Specifies the symbolic name of the target texture, either GL_TEXTURE_1D or GL_TEXTURE_2D.

level

Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the nth mipmap reduction image.

pname

Specifies the symbolic name of a texture parameter. GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_COMPONENTS, and GL_TEXTURE_BORDER are accepted.

params

Returns the requested data.

DESCRIPTION

glGetTexLevelParameter returns in params texture parameter values for a specific level-of-detail value, specified as level. target defines the target texture, either GL_TEXTURE_1D or GL_TEXTURE_2D, to specify one- or two-dimensional texturing. pname specifies the texture parameter whose value or values will be returned.

The accepted parameter names are as follows:

GL_TEXTURE_WIDTH


params returns a single value, the width of the texture image. This value includes the border of the texture image.

GL_TEXTURE_HEIGHT


params returns a single value, the height of the texture image. This value includes the border of the texture image.

GL_TEXTURE_COMPONENTS


params returns a single value, the number of components in the texture image.

GL_TEXTURE_BORDER


params returns a single value, the width in pixels of the border of the texture image.

NOTES

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if target or pname is not an accepted value.

GL_INVALID_VALUE is generated if level is less than zero or greater than log2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.

GL_INVALID_OPERATION is generated if glGetTexLevelParameter is called between a call to glBegin and the corresponding call to glEnd.

glGetTexParameter

NAME

glGetTexParameterfv, glGetTexParameteriv - return texture parameter values

C SPECIFICATION

void glGetTexParameterfv( GLenum target, GLenum pname, GLfloat *params )
void glGetTexParameteriv( GLenum target, GLenum pname, GLint *params )

PARAMETERS

target

Specifies the symbolic name of the target texture. GL_TEXTURE_1D and GL_TEXTURE_2D are accepted.

pname

Specifies the symbolic name of a texture parameter. GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, and GL_TEXTURE_BORDER_COLOR are accepted.

params

Returns the texture parameters.

DESCRIPTION

glGetTexParameter returns in params the value or values of the texture parameter specified as pname. target defines the target texture, either GL_TEXTURE_1D or GL_TEXTURE_2D, to specify one- or two-dimensional texturing. pname accepts the same symbols as glTexParameter, with the same interpretations:

GL_TEXTURE_MAG_FILTER


Returns the single-valued texture magnification filter, a symbolic constant.

GL_TEXTURE_MIN_FILTER


Returns the single-valued texture minification filter, a symbolic constant.

GL_TEXTURE_WRAP_S


Returns the single-valued wrapping function for texture coordinate s, a symbolic constant.

GL_TEXTURE_WRAP_T


Returns the single-valued wrapping function for texture coordinate t, a symbolic constant.

GL_TEXTURE_BORDER_COLOR


Returns four integer or floating-point numbers that comprise the RGBA color of the texture border. Floating-point values are returned in the range [0,1]. Integer values are returned as a linear mapping of the internal floating-point representation such that 1.0 maps to the most positive representable integer and -1.0 maps to the most negative representable integer.

NOTES

If an error is generated, no change is made to the contents of params.

ERRORS

GL_INVALID_ENUM is generated if target or pname is not an accepted value.

GL_INVALID_OPERATION is generated if glGetTexParameter is called between a call to glBegin and the corresponding call to glEnd.

glHint

NAME

glHint - specify implementation-specific hints

C SPECIFICATION

void glHint( GLenum target, GLenum mode )

PARAMETERS

target

Specifies a symbolic constant indicating the behavior to be controlled. GL_FOG_HINT, GL_LINE_SMOOTH_HINT, GL_PERSPECTIVE_CORRECTION_HINT, GL_POINT_SMOOTH_HINT, and GL_POLYGON_SMOOTH_HINT are accepted.

mode

Specifies a symbolic constant indicating the desired behavior. GL_FASTEST, GL_NICEST, and GL_DONT_CARE are accepted.

DESCRIPTION

Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. target is a symbolic constant indicating the behavior to be controlled, and mode is another symbolic constant indicating the desired behavior. mode can be one of the following:

GL_FASTEST

The most efficient option should be chosen.

GL_NICEST

The most correct, or highest quality, option should be chosen.

GL_DONT_CARE


The client doesn't have a preference.

Though the implementation aspects that can be hinted are well defined, the interpretation of the hints depends on the implementation. The hint aspects that can be specified with target, along with suggested semantics, are as follows:

GL_FOG_HINT


Indicates the accuracy of fog calculation. If per-pixel fog calculation is not efficiently supported by the GL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in per-vertex calculation of fog effects.

GL_LINE_SMOOTH_HINT


Indicates the sampling quality of antialiased lines. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.

GL_PERSPECTIVE_CORRECTION_HINT


Indicates the quality of color and texture coordinate interpolation. If perspective-corrected parameter interpolation is not efficiently supported by the GL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in simple linear interpolation of colors and/or texture coordinates.

GL_POINT_SMOOTH_HINT


Indicates the sampling quality of antialiased points. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.

GL_POLYGON_SMOOTH_HINT


Indicates the sampling quality of antialiased polygons. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.

NOTES

The interpretation of hints depends on the implementation. glHint can be ignored.

ERRORS

GL_INVALID_ENUM is generated if either target or mode is not an accepted value.

GL_INVALID_OPERATION is generated if glHint is called between a call to glBegin and the corresponding call to glEnd.

glIndex

NAME

glIndexd, glIndexf, glIndexi, glIndexs, glIndexdv, glIndexfv, glIndexiv, glIndexsv - set the current color index

C SPECIFICATION

void glIndexd( GLdouble c )
void glIndexf( GLfloat c )
void glIndexi( GLint c )
void glIndexs( GLshort c )

PARAMETERS

c

Specifies the new value for the current color index.

C SPECIFICATION

void glIndexdv( const GLdouble *c )
void glIndexfv( const GLfloat *c )
void glIndexiv( const GLint *c )
void glIndexsv( const GLshort *c )

PARAMETERS

c

Specifies a pointer to a one-element array that contains the new value for the current color index.

DESCRIPTION

glIndex updates the current (single-valued) color index. It takes one argument: the new value for the current color index.

The current index is stored as a floating-point value. Integer values are converted directly to floating-point values, with no special mapping.

Index values outside the representable range of the color index buffer are not clamped. However, before an index is dithered (if enabled) and written to the frame buffer, it is converted to fixed-point format. Any bits in the integer portion of the resulting fixed-point value that do not correspond to bits in the frame buffer are masked out.

NOTES

The current index can be updated at any time. In particular, glIndex can be called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_CURRENT_INDEX

SEE ALSO

"glColor"

glIndexMask

NAME

glIndexMask - control the writing of individual bits in the color index buffers

C SPECIFICATION

void glIndexMask( GLuint mask )

PARAMETERS

mask

Specifies a bit mask to enable and disable the writing of individual bits in the color index buffers. Initially, the mask is all ones.

DESCRIPTION

glIndexMask controls the writing of individual bits in the color index buffers. The least significant n bits of mask, where n is the number of bits in a color index buffer, specify a mask. Wherever a one appears in the mask, the corresponding bit in the color index buffer (or buffers) is made writable. Where a zero appears, the bit is write-protected.

This mask is used only in color index mode, and it affects only the buffers currently selected for writing (see "glDrawBuffer" .) Initially, all bits are enabled for writing.

ERRORS

GL_INVALID_OPERATION is generated if glIndexMask is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_INDEX_WRITEMASK

glInitNames

NAME

glInitNames - initialize the name stack

C SPECIFICATION

void glInitNames( void )

DESCRIPTION

The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. glInitNames causes the name stack to be initialized to its default empty state.

The name stack is always empty while the render mode is not GL_SELECT. Calls to glInitNames while the render mode is not GL_SELECT are ignored.

ERRORS

GL_INVALID_OPERATION is generated if glInitNames is called between a call to glBegin and the corresponding call to glEnd.

ASSOCIATED GETS

glGet with argument GL_NAME_STACK_DEPTH
glGet with argument GL_MAX_NAME_STACK_DEPTH

glIsEnabled

NAME

glIsEnabled - test whether a capability is enabled

C SPECIFICATION

GLboolean glIsEnabled( GLenum cap )

PARAMETERS

cap

Specifies a symbolic constant indicating a GL capability.

DESCRIPTION

glIsEnabled returns GL_TRUE if cap is an enabled capability and returns GL_FALSE otherwise. The following capabilities are accepted for cap: