D
glDrawPixels
Chapter 4
125
The following table summarizes the meaning of the valid constants for the type
parameter:
The rasterization described so far assumes pixel zoom factors of 1. If glPixelZoom is used
to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If
(x
r
,y
r
) 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
(x
r
+ zoom
x
n, y
r
+ zoom
y
m)
(x
r
+ zoom
x
(n + 1), y
r
+ zoom
y
(m + 1))
where zoom
x
is the value of GL_ZOOM_X and zoom
y
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 executed between the
execution of glBegin and the corresponding execution of glEnd.
Associated Gets
glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_POSITION_VALID
Table 4-1
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 integers
GL_SHORT Signed 16-bit integers
GL_UNSIGNED_INT Unsigned 32-bit integers
GL_INT 32-bit integer
GL_FLOAT Single-precision floating-point