GlTexSubImage2D

From QB64 Phoenix Edition Wiki
Revision as of 13:03, 5 May 2022 by RhoSigma (talk | contribs) (Protected "GlTexSubImage2D" ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
Jump to navigation Jump to search

_glTexSubImage2D: specify a two-dimensional texture subimage


Syntax

 SUB _glTexSubImage2D (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL xoffset AS LONG, BYVAL yoffset AS LONG, BYVAL width AS LONG, BYVAL height AS LONG, BYVAL format AS _UNSIGNED LONG, BYVAL type AS _UNSIGNED LONG, pixels AS _OFFSET)
 void _glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * data);


target
Specifies the target texture. Must be Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, or Template:KW.
level
Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
xoffset
Specifies a texel offset in the x direction within the texture array.
yoffset
Specifies a texel offset in the y direction within the texture array.
width
Specifies the width of the texture subimage.
height
Specifies the height of the texture subimage.

Template:Glapi pixeltransferupparams


Description

Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled.

_glTexSubImage2D redefines a contiguous subregion of an existing two-dimensional or one-dimensional array texture image. The texels referenced by data replace the portion of the existing texture array with x indices xoffset and xoffset + width - 1, inclusive, and y indices yoffset 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.

If a non-zero named buffer object is bound to the Template:KW target (see Template:KW) while a texture image is specified, data is treated as a byte offset into the buffer object's data store.


Template:PageNotes

Template:KW modes affect texture images.

_glTexSubImage2D specifies a two-dimensional subtexture for the current texture unit, specified with Template:KW.


Template:PageErrors

Template:KW is generated if target is not Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, or Template:KW.

Template:KW is generated if format is not an accepted format constant.

Template:KW is generated if type is not a type constant.

Template:KW is generated if level is less than 0.

Template:KW may be generated if level is greater than log<sub>2</sub>(max), where max is the returned value of Template:KW.

Template:KW is generated if xoffset < 0, (xoffset + width) > w, yoffset < 0, or (yoffset + height) > h, where w is the Template:KW and h is the Template:KW.

Template:KW is generated if width or height is less than 0.

Template:KW is generated if the texture array has not been defined by a previous Template:KW operation.

Template:KW is generated if type is one of Template:KW, Template:KW, Template:KW, or Template:KW and format is not Template:KW.

Template:KW is generated if type is one of Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, or Template:KW and format is neither Template:KW nor Template:KW.

Template:KW is generated if a non-zero buffer object name is bound to the Template:KW target and the buffer object's data store is currently mapped.

Template:KW is generated if a non-zero buffer object name is bound to the Template:KW target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.

Template:KW is generated if a non-zero buffer object name is bound to the Template:KW target and data is not evenly divisible into the number of bytes needed to store in memory a datum indicated by type.


Template:PageUseWith

Template:KW

Template:KW with argument Template:KW


See also

SUB _GL Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW, Template:KW


Template:PageCopyright



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link