1GLCOPYTEXSUBIMAGE2D(3G) GLCOPYTEXSUBIMAGE2D(3G)
2
3
4
6 glCopyTexSubImage2D - copy a two-dimensional texture subimage
7
8
10 void glCopyTexSubImage2D( GLenum target,
11 GLint level,
12 GLint xoffset,
13 GLint yoffset,
14 GLint x,
15 GLint y,
16 GLsizei width,
17 GLsizei height )
18
19
21 target Specifies the target texture. Must be GL_TEXTURE_2D.
22
23 level Specifies the level-of-detail number. Level 0 is the base
24 image level. Level n is the nth mipmap reduction image.
25
26 xoffset Specifies a texel offset in the x direction within the texture
27 array.
28
29 yoffset Specifies a texel offset in the y direction within the texture
30 array.
31
32 x, y Specify the window coordinates of the lower left corner of the
33 rectangular region of pixels to be copied.
34
35 width Specifies the width of the texture subimage.
36
37 height Specifies the height of the texture subimage.
38
40 glCopyTexSubImage2D replaces a rectangular portion of a two-dimensional
41 texture image with pixels from the current GL_READ_BUFFER (rather than
42 from main memory, as is the case for glTexSubImage2D).
43
44 The screen-aligned pixel rectangle with lower left corner at (x, y) and
45 with width width and height height replaces the portion of the texture
46 array with x indices xoffset through xoffset+width−1, inclusive, and y
47 indices yoffset through yoffset+height−1, inclusive, at the mipmap
48 level specified by level.
49
50 The pixels in the rectangle are processed exactly as if glCopyPixels
51 had been called, but the process stops just before final conversion.
52 At this point, all pixel component values are clamped to the range
53 [0, 1] and then converted to the texture's internal for storage in the
54 texel array.
55
56 The destination rectangle in the texture array may not include any tex‐
57 els outside the texture array as it was originally specified. It is
58 not an error to specify a subtexture with zero width or height, but
59 such a specification has no effect.
60
61 If any of the pixels within the specified rectangle of the current
62 GL_READ_BUFFER are outside the read window associated with the current
63 rendering context, then the values obtained for those pixels are unde‐
64 fined.
65
66 No change is made to the internalformat, width, height, or border
67 parameters of the specified texture array or to texel values outside
68 the specified subregion.
69
71 glCopyTexSubImage2D is available only if the GL version is 1.1 or
72 greater.
73
74 Texturing has no effect in color index mode.
75
76 glPixelStore and glPixelTransfer modes affect texture images in exactly
77 the way they affect glDrawPixels.
78
79 When the GL_ARB_imaging extension is supported, the RGBA components
80 read from the framebuffer may be processed by the imaging pipeline.
81 See glTexImage1D for specific details.
82
84 GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D.
85
86 GL_INVALID_OPERATION is generated if the texture array has not been
87 defined by a previous glTexImage2D or glCopyTexImage2D operation.
88
89 GL_INVALID_VALUE is generated if level is less than 0.
90
91 GL_INVALID_VALUE may be generated if level is greater than log2max,
92 where max is the returned value of GL_MAX_TEXTURE_SIZE.
93
94 GL_INVALID_VALUE is generated if x<−b or if y<−b, where b is the border
95 width of the texture array.
96
97 GL_INVALID_VALUE is generated if xoffset<−b, (xoffset+width)>(w−b),
98 yoffset<−b, or (yoffset+height)>(h−b), where w is the GL_TEXTURE_WIDTH,
99 h is the GL_TEXTURE_HEIGHT, and b is the GL_TEXTURE_BORDER of the tex‐
100 ture image being modified. Note that w and h include twice the border
101 width.
102
103 GL_INVALID_OPERATION is generated if glCopyTexSubImage2D is executed
104 between the execution of glBegin and the corresponding execution of
105 glEnd.
106
108 glGetTexImage
109 glIsEnabled with argument GL_TEXTURE_2D
110
112 glCopyPixels(3G), glCopyTexImage1D(3G), glCopyTexImage2D(3G),
113 glCopyTexSubImage1D(3G), glCopyTexSubImage3D(3G), glPixelStore(3G),
114 glPixelTransfer(3G), glReadBuffer(3G), glTexEnv(3G), glTexGen(3G),
115 glTexImage1D(3G), glTexImage2D(3G), glTexImage3D(3G),
116 glTexParameter(3G), glTexSubImage1D(3G), glTexSubImage2D(3G),
117 glTexSubImage3D(3G)
118
119
120
121 GLCOPYTEXSUBIMAGE2D(3G)