1GLTEXSUBIMAGE2D(3G) [FIXME: manual] GLTEXSUBIMAGE2D(3G)
2
3
4
6 glTexSubImage2D, glTextureSubImage2D - specify a two-dimensional
7 texture subimage
8
10 void glTexSubImage2D(GLenum target, GLint level, GLint xoffset,
11 GLint yoffset, GLsizei width, GLsizei height,
12 GLenum format, GLenum type,
13 const GLvoid * pixels);
14
15 void glTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
16 GLint yoffset, GLsizei width, GLsizei height,
17 GLenum format, GLenum type,
18 const void *pixels);
19
21 target
22 Specifies the target to which the texture is bound for
23 glTexSubImage2D. Must be GL_TEXTURE_2D,
24 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
25 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
26 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or
27 GL_TEXTURE_1D_ARRAY.
28
29 texture
30 Specifies the texture object name for glTextureSubImage2D. The
31 effective target of texture must be one of the valid target values
32 above.
33
34 level
35 Specifies the level-of-detail number. Level 0 is the base image
36 level. Level n is the nth mipmap reduction image.
37
38 xoffset
39 Specifies a texel offset in the x direction within the texture
40 array.
41
42 yoffset
43 Specifies a texel offset in the y direction within the texture
44 array.
45
46 width
47 Specifies the width of the texture subimage.
48
49 height
50 Specifies the height of the texture subimage.
51
52 format
53 Specifies the format of the pixel data. The following symbolic
54 values are accepted: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA,
55 GL_BGRA, GL_DEPTH_COMPONENT, and GL_STENCIL_INDEX.
56
57 type
58 Specifies the data type of the pixel data. The following symbolic
59 values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT,
60 GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT,
61 GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
62 GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV,
63 GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
64 GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
65 GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
66 GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV.
67
68 pixels
69 Specifies a pointer to the image data in memory.
70
72 Texturing maps a portion of a specified texture image onto each
73 graphical primitive for which texturing is enabled.
74
75 glTexSubImage2D and glTextureSubImage2D redefine a contiguous subregion
76 of an existing two-dimensional or one-dimensional array texture image.
77 The texels referenced by pixels replace the portion of the existing
78 texture array with x indices xoffset and xoffset + width - 1,
79 inclusive, and y indices yoffset and yoffset + height - 1, inclusive.
80 This region may not include any texels outside the range of the texture
81 array as it was originally specified. It is not an error to specify a
82 subtexture with zero width or height, but such a specification has no
83 effect.
84
85 If a non-zero named buffer object is bound to the
86 GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer()) while a texture
87 image is specified, pixels is treated as a byte offset into the buffer
88 object's data store.
89
91 glPixelStore() modes affect texture images.
92
93 glTexSubImage2D and glTextureSubImage3D specify a two-dimensional
94 subtexture for the current texture unit, specified with
95 glActiveTexture().
96
97 GL_STENCIL_INDEX is accepted for format only if the GL version is 4.4
98 or higher.
99
101 GL_INVALID_ENUM is generated if target or the effective target of
102 texture is not GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
103 GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
104 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
105 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or GL_TEXTURE_1D_ARRAY.
106
107 GL_INVALID_OPERATION is generated by glTextureSubImage2D if texture is
108 not the name of an existing texture object.
109
110 GL_INVALID_ENUM is generated if format is not an accepted format
111 constant.
112
113 GL_INVALID_ENUM is generated if type is not a type constant.
114
115 GL_INVALID_VALUE is generated if level is less than 0.
116
117 GL_INVALID_VALUE may be generated if level is greater than log 2 max,
118 where max is the returned value of GL_MAX_TEXTURE_SIZE.
119
120 GL_INVALID_VALUE is generated if xoffset < - b, xoffset + width > w -
121 b, yoffset < - b, or yoffset + height > h - b, where w is the
122 GL_TEXTURE_WIDTH, h is the GL_TEXTURE_HEIGHT, and b is the border width
123 of the texture image being modified. Note that w and h include twice
124 the border width.
125
126 GL_INVALID_VALUE is generated if width or height is less than 0.
127
128 GL_INVALID_OPERATION is generated if the texture array has not been
129 defined by a previous glTexImage2D() operation.
130
131 GL_INVALID_OPERATION is generated if type is one of
132 GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV,
133 GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV and format is
134 not GL_RGB.
135
136 GL_INVALID_OPERATION is generated if type is one of
137 GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV,
138 GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV,
139 GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV,
140 GL_UNSIGNED_INT_10_10_10_2, or GL_UNSIGNED_INT_2_10_10_10_REV and
141 format is neither GL_RGBA nor GL_BGRA.
142
143 GL_INVALID_OPERATION is generated if format is GL_STENCIL_INDEX and the
144 base internal format is not GL_STENCIL_INDEX.
145
146 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
147 bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data
148 store is currently mapped.
149
150 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
151 bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be
152 unpacked from the buffer object such that the memory reads required
153 would exceed the data store size.
154
155 GL_INVALID_OPERATION is generated if a non-zero buffer object name is
156 bound to the GL_PIXEL_UNPACK_BUFFER target and pixels is not evenly
157 divisible into the number of bytes needed to store in memory a datum
158 indicated by type.
159
161 glGetTexImage()
162
163 glGet() with argument GL_PIXEL_UNPACK_BUFFER_BINDING
164
166 ┌────────────────────┬───────────────────────────────────────────────────────────────────────┐
167 │ │ OpenGL Version │
168 ├────────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
169 │Function │ 2.0 │ 2.1 │ 3.0 │ 3.1 │ 3.2 │ 3.3 │ 4.0 │ 4.1 │ 4.2 │ 4.3 │ 4.4 │ 4.5 │
170 │/ │ │ │ │ │ │ │ │ │ │ │ │ │
171 │Feature │ │ │ │ │ │ │ │ │ │ │ │ │
172 │Name │ │ │ │ │ │ │ │ │ │ │ │ │
173 ├────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
174 │glTexSubImage2D │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │ ✔ │
175 ├────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
176 │glTextureSubImage2D │ - │ - │ - │ - │ - │ - │ - │ - │ - │ - │ - │ ✔ │
177 └────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
178
180 glActiveTexture(), glCopyTexImage1D(), glCopyTexImage2D(),
181 glCopyTexSubImage1D(), glCopyTexSubImage2D(), glCopyTexSubImage3D(),
182 glPixelStore(), glTexImage1D(), glTexImage2D(), glTexImage3D(),
183 glTexSubImage1D(), glTexSubImage3D(), glTexParameter()
184
186 Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014
187 Khronos Group. This document is licensed under the SGI Free Software B
188 License. For details, see http://oss.sgi.com/projects/FreeB/.
189
191 Copyright © 1991-2006 Silicon Graphics, Inc.
192 Copyright © 2010-2014 Khronos Group
193
194
195
196[FIXME: source] 03/06/2019 GLTEXSUBIMAGE2D(3G)