- copy a two-dimensional texture subimage
C SPECIFICATION
PARAMETERS
_param1 Specifies the target texture. Must be
GL_TEXTURE_2D.
_param2 Specifies the level-of-detail number. Level 0 is
the base image level. Level n is the nth mipmap
reduction image.
_param3 Specifies a texel offset in the x direction
within the texture array.
_param4 Specifies a texel offset in the y direction
within the texture array.
_param5, _param6
Specify the window coordinates of the lower left
corner of the rectangular region of pixels to be
copied.
_param7 Specifies the width of the texture subimage.
_param8 Specifies the height of the texture subimage.
DESCRIPTION
glCopyTexSubImage2D replaces a rectangular portion of a
two-dimensional texture image with pixels from the current
GL_READ_BUFFER (rather than from main memory, as is the
case for glTexSubImage2D).
The screen-aligned pixel rectangle with lower left corner
at (_param5, _param6) and with width _param7 and height
_param8 replaces the portion of the texture array with x
indices _param3 through _param3+_param7-1, inclusive, and
y indices _param4 through _param4+_param8-1, inclusive, at
the mipmap level specified by _param2.
The pixels in the rectangle are processed exactly as if
glCopyPixels had been called, but the process stops just
before final conversion. At this point, all pixel compo-
nent values are clamped to the range [0, 1] and then con-
verted to the texture's internal for storage in the texel
array.
The destination rectangle in the texture array may not
include any texels outside the texture array as it was
originally specified. It is not an error to specify a
subtexture with zero width or height, but such a specifi-
cation has no effect.
Texturing has no effect in color index mode.
glPixelStore and glPixelTransfer modes affect texture
images in exactly the way they affect glDrawPixels.
When the GL_ARB_imaging extension is supported, the RGBA
components read from the framebuffer may be processed by
the imaging pipeline. See glTexImage1D for specific
details.
ERRORS
GL_INVALID_ENUM is generated if _param1 is not
GL_TEXTURE_2D.
GL_INVALID_OPERATION is generated if the texture array has
not been defined by a previous glTexImage2D or
glCopyTexImage2D operation.
GL_INVALID_VALUE is generated if _param2 is less than 0.
GL_INVALID_VALUE may be generated if _param2 is greater
than log2max, where max is the returned value of
GL_MAX_TEXTURE_SIZE.
GL_INVALID_VALUE is generated if _param5<-b or if
_param6<-b, where b is the border width of the texture
array.
GL_INVALID_VALUE is generated if _eqnparam3<-b,
(_param3+_param7)>(w-b), _param4<-b, or
(_param4+_param8)>(h-b), where w is the GL_TEXTURE_WIDTH,
h is the GL_TEXTURE_HEIGHT, and b is the
GL_TEXTURE_BORDER of the texture image being modified.
Note that w and h include twice the border width.
GL_INVALID_OPERATION is generated if glCopyTexSubImage2D
is executed between the execution of glBegin and the cor-
responding execution of glEnd.
ASSOCIATED GETS
glGetTexImage
glIsEnabled with argument GL_TEXTURE_2D
SEE ALSO
glCopyPixels, glCopyTexImage1D, glCopyTexImage2D,
glCopyTexSubImage1D, glCopyTexSubImage3D, glPixelStore,
glPixelTransfer, glReadBuffer, glTexEnv, glTexGen,
glTexImage1D, glTexImage2D, glTexImage3D, glTexParameter,
glTexSubImage1D, glTexSubImage2D, glTexSubImage3D