1GLCOPYTEXSUBIMAGE2D(3G)          OpenGL Manual         GLCOPYTEXSUBIMAGE2D(3G)
2
3
4

NAME

6       glCopyTexSubImage2D - copy a two-dimensional texture subimage
7

C SPECIFICATION

9       void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset,
10                                GLint yoffset, GLint x, GLint y,
11                                GLsizei width, GLsizei height);
12

PARAMETERS

14       target
15           Specifies the target texture. Must be GL_TEXTURE_2D,
16           GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
17           GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
18           GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or
19           GL_TEXTURE_1D_ARRAY.
20
21       level
22           Specifies the level-of-detail number. Level 0 is the base image
23           level. Level n is the nth mipmap reduction image.
24
25       xoffset
26           Specifies a texel offset in the x direction within the texture
27           array.
28
29       yoffset
30           Specifies a texel offset in the y direction within the texture
31           array.
32
33       x, y
34           Specify the window coordinates of the lower left corner of the
35           rectangular region of pixels to be copied.
36
37       width
38           Specifies the width of the texture subimage.
39
40       height
41           Specifies the height of the texture subimage.
42

DESCRIPTION

44       glCopyTexSubImage2D replaces a rectangular portion of a two-dimensional
45       texture image, cube-map texture image or a linear portion of a number
46       of slices of a one-dimensional array texture with pixels from the
47       current GL_READ_BUFFER (rather than from main memory, as is the case
48       for glTexSubImage2D()).
49
50       The screen-aligned pixel rectangle with lower left corner at x y and
51       with width width and height height replaces the portion of the texture
52       array with x indices xoffset through xoffset + width - 1, inclusive,
53       and y indices yoffset through yoffset + height - 1, inclusive, at the
54       mipmap level specified by level.
55
56       The pixels in the rectangle are processed exactly as if glReadPixels()
57       had been called, but the process stops just before final conversion. At
58       this point, all pixel component values are clamped to the range 0 1 and
59       then converted to the texture's internal format for storage in the
60       texel array.
61
62       The destination rectangle in the texture array may not include any
63       texels outside the texture array as it was originally specified. It is
64       not an error to specify a subtexture with zero width or height, but
65       such a specification has no effect.
66
67       When target is GL_TEXTURE_1D_ARRAY then the y coordinate and height are
68       treated as the start slice and number of slices to modify.
69
70       If any of the pixels within the specified rectangle of the current
71       GL_READ_BUFFER are outside the read window associated with the current
72       rendering context, then the values obtained for those pixels are
73       undefined.
74
75       No change is made to the internalformat, width, height, or border
76       parameters of the specified texture array or to texel values outside
77       the specified subregion.
78

NOTES

80       glPixelStore() modes affect texture images.
81

ERRORS

83       GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D,
84       GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
85       GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
86       GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, or
87       GL_TEXTURE_1D_ARRAY.
88
89       GL_INVALID_OPERATION is generated if the texture array has not been
90       defined by a previous glTexImage2D() or glCopyTexImage2D() operation.
91
92       GL_INVALID_VALUE is generated if level is less than 0.
93
94       GL_INVALID_VALUE may be generated if level > log 2 ⁡ max, where max is
95       the returned value of GL_MAX_TEXTURE_SIZE.
96
97       GL_INVALID_VALUE is generated if xoffset < - b, xoffset + width > w -
98       b, yoffset < - b, or yoffset + height > h - b, where w is the
99       GL_TEXTURE_WIDTH, h is the GL_TEXTURE_HEIGHT, and b is the
100       GL_TEXTURE_BORDER of the texture image being modified. Note that w and
101       h include twice the border width.
102

ASSOCIATED GETS

104       glGetTexImage()
105

SEE ALSO

107       glCopyTexImage1D(), glCopyTexImage2D(), glCopyTexSubImage1D(),
108       glCopyTexSubImage3D(), glPixelStore(), glReadBuffer(), glTexImage1D(),
109       glTexImage2D(), glTexImage3D(), glTexParameter(), glTexSubImage1D(),
110       glTexSubImage2D(), glTexSubImage3D()
111
113       Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2012 Khronos
114       Group. This document is licensed under the SGI Free Software B License.
115       For details, see http://oss.sgi.com/projects/FreeB/.
116

AUTHORS

118       opengl.org
119
120
121
122opengl.org                        06/10/2014           GLCOPYTEXSUBIMAGE2D(3G)
Impressum