![]() -> Click here to learn how to get live help <- |
GLTEXSUBIMAGE2DIndexNAMEglTexSubImage2D - specify a two-dimensional texture subimageC SPECIFICATIONvoid f3glTexSubImage2DfP( GLenum fItargetfP,f2targetfP Specifies the target texture. Must be %f3GL_TEXTURE_2DfP.
DESCRIPTIONTexturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable two-dimensional texturing, call %f3glEnablefP and %f3glDisablefP with argument %f3GL_TEXTURE_2DfP. %f3glTexSubImage2DfP redefines a contiguous subregion of an existing two-dimensional texture image. The texels referenced by f2pixelsfP replace the portion of the existing texture array with x indices f2xoffsetfP and $"xoffset"~+~"width"~-~1$, inclusive, and y indices f2yoffsetfP and $"yoffset"~+~"height"~-~1$, inclusive. This region may not include any texels outside the range of 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 specification has no effect.NOTES%f3glTexSubImage2DfP is available only if the GL version is 1.1 or greater. Texturing has no effect in color index mode. %f3glPixelStorefP and %f3glPixelTransferfP modes affect texture images in exactly the way they affect %f3glDrawPixelsfP. Formats %f3GL_BGRfP, and %f3GL_BGRAfP and types %f3GL_UNSIGNED_BYTE_3_3_2fP, %f3GL_UNSIGNED_BYTE_2_3_3_REVfP, %f3GL_UNSIGNED_SHORT_5_6_5fP, %f3GL_UNSIGNED_SHORT_5_6_5_REVfP, %f3GL_UNSIGNED_SHORT_4_4_4_4fP, %f3GL_UNSIGNED_SHORT_4_4_4_4_REVfP, %f3GL_UNSIGNED_SHORT_5_5_5_1fP, %f3GL_UNSIGNED_SHORT_1_5_5_5_REVfP, %f3GL_UNSIGNED_INT_8_8_8_8fP, %f3GL_UNSIGNED_INT_8_8_8_8_REVfP, %f3GL_UNSIGNED_INT_10_10_10_2fP, and %f3GL_UNSIGNED_INT_2_10_10_10_REVfP are available only if the GL version is 1.2 or greater. When the %f3GL_ARB_multitexturefP extension is supported, %f3glTexSubImage2DfP specifies a two-dimensional sub texture for the current texture unit, specified with %f3glActiveTextureARBfP. When the %f3GL_ARB_imagingfP extension is supported, the RGBA components specified in f2pixelsfP may be processed by the imaging pipeline. See %f3glTexImage1DfP for specific details.ERRORS%f3GL_INVALID_ENUMfP is generated if f2targetfP is not %f3GL_TEXTURE_2DfP. %f3GL_INVALID_OPERATIONfP is generated if the texture array has not been defined by a previous %f3glTexImage2DfP operation. %f3GL_INVALID_VALUEfP is generated if f2levelfP is less than 0. %f3GL_INVALID_VALUEfP may be generated if f2levelfP is greater than $log sub 2$f2maxfP, where f2maxfP is the returned value of %f3GL_MAX_TEXTURE_SIZEfP. %f3GL_INVALID_VALUEfP is generated if $"xoffset" ~<~ ~-b$, $("xoffset"~+~"width") ~>~ (w~-~b)$, $"yoffset" ~<~ ~-b$, or $("yoffset" ~+~ "height") ~>~ (h~-~b)$, where $w$ is the %f3GL_TEXTURE_WIDTHfP, $h$ is the %f3GL_TEXTURE_HEIGHTfP, and $b$ is the border width of the texture image being modified. Note that $w$ and $h$ include twice the border width. %f3GL_INVALID_VALUEfP is generated if f2widthfP or f2heightfP is less than 0. %f3GL_INVALID_ENUMfP is generated if f2formatfP is not an acceptedconstant. %f3GL_INVALID_ENUMfP is generated if f2typefP is not a type constant. %f3GL_INVALID_ENUMfP is generated if f2typefP is %f3GL_BITMAPfP and f2formatfP is not %f3GL_COLOR_INDEXfP. %f3GL_INVALID_OPERATIONfP is generated if %f3glTexSubImage2DfP is executed between the execution of %f3glBeginfP and the corresponding execution of %f3glEndfP. %f3GL_INVALID_OPERATIONfP is generated if f2typefP is one of %f3GL_UNSIGNED_BYTE_3_3_2fP, %f3GL_UNSIGNED_BYTE_2_3_3_REVfP, %f3GL_UNSIGNED_SHORT_5_6_5fP, or %f3GL_UNSIGNED_SHORT_5_6_5_REVfP and f2formatfP is not %f3GL_RGBfP. %f3GL_INVALID_OPERATIONfP is generated if f2typefP is one of %f3GL_UNSIGNED_SHORT_4_4_4_4fP, %f3GL_UNSIGNED_SHORT_4_4_4_4_REVfP, %f3GL_UNSIGNED_SHORT_5_5_5_1fP, %f3GL_UNSIGNED_SHORT_1_5_5_5_REVfP, %f3GL_UNSIGNED_INT_8_8_8_8fP, %f3GL_UNSIGNED_INT_8_8_8_8_REVfP, %f3GL_UNSIGNED_INT_10_10_10_2fP, or %f3GL_UNSIGNED_INT_2_10_10_10_REVfP and f2formatfP is neither %f3GL_RGBAfP nor %f3GL_BGRAfP. ASSOCIATED GETS%f3glGetTexImagefP%f3glIsEnabledfP with argument %f3GL_TEXTURE_2DfP SEE ALSO%f3glActiveTextureARB(3G)fP, %f3glCopyTexImage1D(3G)fP, %f3glCopyTexImage2D(3G)fP, %f3glCopyTexSubImage1D(3G)fP, %f3glCopyTexSubImage2D(3G)fP, %f3glCopyTexSubImage3D(3G)fP, %f3glDrawPixels(3G)fP, %f3glPixelStore(3G)fP, %f3glPixelTransfer(3G)fP, %f3glTexEnv(3G)fP, %f3glTexGen(3G)fP, %f3glTexImage1D(3G)fP, %f3glTexImage2D(3G)fP, %f3glTexImage3D(3G)fP, %f3glTexSubImage1D(3G)fP, %f3glTexSubImage3D(3G)fP, %f3glTexParameter(3G)fP
Index |