glPixelStorei - set pixel storage modes
void glPixelStorei(GLenum pname, GLint param)
pnameSpecifies the symbolic name of the parameter to be set. GL_PACK_ALIGNMENT affects the packing of pixel data into memory. GL_UNPACK_ALIGNMENT affects the unpacking of pixel data from memory.
paramSpecifies the value that pname is set to.
glPixelStore sets pixel storage modes that affect the operation of subsequent glReadPixels as well as the unpacking of glTexImage2D, and glTexSubImage2D.
pname is a symbolic constant indicating the parameter to be set, and param is the new value. The following storage parameter affects how pixel data is returned to client memory. This value is significant for glReadPixels:
GL_PACK_ALIGNMENTSpecifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). The initial value is 4.
The following storage parameter affects how pixel data is read from client memory. This value is significant for glTexImage2D and glTexSubImage2D:
GL_UNPACK_ALIGNMENTSpecifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries). The initial value is 4.
Pixel storage modes are client states.
glCompressedTexImage2D and glCompressedTexSubImage2D are not affected by glPixelStore.
GL_INVALID_ENUM is generated if pname is not an accepted value.
GL_INVALID_VALUE is generated if alignment is specified as other than 1, 2, 4, or 8.
Copyright © 2003 Silicon Graphics, Inc.
This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
glReadPixels, glCompressedTexImage2D, glCompressedTexSubImage2D, glTexImage2D, glTexSubImage2D