1Name 2 3 EXT_copy_texture 4 5Name Strings 6 7 GL_EXT_copy_texture 8 9Version 10 11 $Date: 1995/06/17 03:33:42 $ $Revision: 1.21 $ 12 13Number 14 15 10 16 17Dependencies 18 19 EXT_texture is required. 20 EXT_texture3D affects the definition of this extension. 21 SGIS_texture_filter4 affects the definition of this extension. 22 EXT_subtexture affects the definition of this extension. 23 24Overview 25 26 This extension defines methods to load texture images directly from the 27 framebuffer. Methods are defined for both complete and partial 28 replacement of a texture image. Because it is not possible to define 29 an entire 3D texture using a 2D framebuffer image, 3D textures are 30 supported only for partial replacement. 31 32New Procedures and Functions 33 34 void CopyTexImage1DEXT(enum target, 35 int level, 36 enum internalformat, 37 int x, 38 int y, 39 sizei width, 40 int border); 41 42 void CopyTexImage2DEXT(enum target, 43 int level, 44 enum internalformat, 45 int x, 46 int y, 47 sizei width, 48 sizei height, 49 int border); 50 51 void CopyTexSubImage1DEXT(enum target, 52 int level, 53 int xoffset, 54 int x, 55 int y, 56 sizei width); 57 58 void CopyTexSubImage2DEXT(enum target, 59 int level, 60 int xoffset, 61 int yoffset, 62 int x, 63 int y, 64 sizei width, 65 sizei height); 66 67 void CopyTexSubImage3DEXT(enum target, 68 int level, 69 int xoffset, 70 int yoffset, 71 int zoffset, 72 int x, 73 int y, 74 sizei width, 75 sizei height); 76 77New Tokens 78 79 None 80 81Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 82 83 None 84 85Additions to Chapter 3 of the 1.0 Specification (Rasterization) 86 87 CopyTexImage1DEXT and CopyTexImage2DEXT are related to TexImage1D and 88 TexImage2D in exactly the way that CopyPixels is related to DrawPixels. 89 Rather than accepting image data from memory, they copy image data from 90 the color buffer specified by the current ReadBuffer mode. 91 CopyTexImage2DEXT accepts image data from a width+2*border pixel wide by 92 height+2*border pixel high color buffer region whose lower-left pixel 93 has window coordinates <x>,<y>. If any pixels within this region are 94 outside the window that is associated with the GL context, the values 95 obtained for those pixels are undefined. These pixel values are 96 processed exactly as if CopyPixels had been called, but the process 97 stops just before final conversion. Subsequent processing is exactly 98 as though TexImage2D had be called, beginning with the clamping of the 99 pixel group components to [0,1]. Pixel ordering is such that lower X 100 screen coordinates correspond to lower i texture coordinates, and lower 101 Y screen coordinates correspond to lower j texture coordinates (refer to 102 Figure 3.10 - A texture image and the coordinates used to access it, GL 103 Specification). The semantics and accepted values of the <target>, 104 <level>, and <border> parameters are exactly equivalent to their 105 TexImage2D counterparts, except that <target> does not accept 106 PROXY_TEXTURE_2D_EXT. The semantics of <internalformat> are identical 107 to those of the <components> parameter of TexImage2D, except that 108 values 1, 2, 3, and 4 are not accepted by CopyTexImage2DEXT. 109 110 CopyTexImage1DEXT accepts image data from a width+2*border pixel wide 111 by 1 pixel high color buffer region whose left-most pixel has window 112 coordinates <x>,<y>. If any pixels within this region are outside the 113 window that is associated with the GL context, the values obtained for 114 those pixels are undefined. The pixels are processed just as those of 115 CopyTexImage2DEXT are, and they define a texture such that lower X 116 window coordinates correspond to lower i texture coordinates, as per 117 Figure 3.10 of the GL Specification. The semantics and accepted values 118 of the <level>, <border>, and <internalformat> parameters are exactly 119 those of CopyTexImage2DEXT. <target> accepts only TEXTURE_1D. 120 121 If EXT_subtexture is supported, this extension also defines 122 CopyTexSubImage1DEXT and CopyTexSubImage2DEXT. These commands are 123 related to TexSubImage1DEXT and TexSubImage2DEXT in exactly the way 124 that CopyPixels is related to DrawPixels. Rather than accepting image 125 data from memory, they copy image data from the framebuffer. The 126 semantics and accepted values of the <target>, <level>, <xoffset>, and 127 <yoffset> parameters are exactly equivalent to their TexSubImage1DEXT 128 and TexSubImage2DEXT counterparts. The semantics and accepted values 129 of the <x>, <y>, <width>, and <height> parameters are exactly equivalent 130 to their CopyTexImage1DEXT and CopyTexImage2DEXT counterparts. 131 132 If EXT_subtexture and EXT_texture3D are both supported, this extension 133 also defines CopyTexSubImage3DEXT. Because framebuffer memory is two- 134 dimensional, only a portion of a single s,t slice of a 3D texture is 135 replaced by this command. Thus CopyTexSubImage3DEXT is related to 136 TexSubImage3DEXT in exactly the way that CopyPixels is related to 137 DrawPixels, except that it is as though TexSubImage3DEXT parameter 138 <depth> were 1. Rather than accepting image data from memory, 139 CopyTexSubImage3DEXT copies image data from the framebuffer. The 140 semantics and accepted values of the <target>, <level>, <xoffset>, 141 <yoffset>, and <zoffset> parameters are exactly equivalent to their 142 TexSubImage3DEXT counterparts. The semantics and accepted values of 143 the <x>, <y>, <width>, and <height> parameters are exactly equivalent 144 to their CopyTexImage2DEXT counterparts. 145 146Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 147and the Framebuffer) 148 149 None 150 151Additions to Chapter 5 of the 1.0 Specification (Special Functions) 152 153 None 154 155Additions to Chapter 6 of the 1.0 Specification (State and State Requests) 156 157 None 158 159Additions to the GLX Specification 160 161 None 162 163GLX Protocol 164 165 Five new GL rendering commands are added. The following commands are sent to the 166 server as part of a glXRender request: 167 168 CopyTexImage1DEXT 169 2 32 rendering command length 170 2 4119 rendering command opcode 171 4 ENUM target 172 4 INT32 level 173 4 ENUM internalformat 174 4 INT32 x 175 4 INT32 y 176 4 INT32 width 177 4 INT32 border 178 179 CopyTexImage2DEXT 180 2 36 rendering command length 181 2 4120 rendering command opcode 182 4 ENUM target 183 4 INT32 level 184 4 ENUM internalformat 185 4 INT32 x 186 4 INT32 y 187 4 INT32 width 188 4 INT32 height 189 4 INT32 border 190 191 CopyTexSubImage1DEXT 192 2 28 rendering command length 193 2 4121 rendering command opcode 194 4 ENUM target 195 4 INT32 level 196 4 INT32 xoffset 197 4 INT32 x 198 4 INT32 y 199 4 INT32 width 200 201 CopyTexSubImage2DEXT 202 2 36 rendering command length 203 2 4122 rendering command opcode 204 4 ENUM target 205 4 INT32 level 206 4 INT32 xoffset 207 4 INT32 yoffset 208 4 INT32 x 209 4 INT32 y 210 4 INT32 width 211 4 INT32 height 212 213 CopyTexSubImage3DEXT 214 2 40 rendering command length 215 2 4123 rendering command opcode 216 4 ENUM target 217 4 INT32 level 218 4 INT32 xoffset 219 4 INT32 yoffset 220 4 INT32 zoffset 221 4 INT32 x 222 4 INT32 y 223 4 INT32 width 224 4 INT32 height 225 226Dependencies on EXT_texture 227 228 EXT_texture is required. This extension builds on the notion of 229 internal image format, which is defined by EXT_texture. 230 231Dependencies on EXT_texture3D 232 233 If EXT_texture3D is not supported, CopyTexSubImage3DEXT is not defined 234 by this extension. 235 236Dependencies on SGIS_texture_filter4 237 238 If SGIS_texture_filter4 is not supported, 2 is not accepted as a border 239 value. 240 241Dependencies on EXT_subtexture 242 243 If EXT_subtexture is not supported, CopyTexSubImage1DEXT, 244 CopyTexSubImage2DEXT, and CopyTexSubImage3DEXT are not defined by this 245 extension. 246 247Errors 248 249 INVALID_ENUM is generated if CopyTexImage1DEXT or CopyTexSubImage1DEXT 250 parameter <target> is not TEXTURE_1D. (The commands defined by this 251 extension do not accept PROXY targets.) 252 253 INVALID_ENUM is generated if CopyTexImage2DEXT or CopyTexSubImage2DEXT 254 parameter <target> is not TEXTURE_2D. 255 256 INVALID_ENUM is generated if CopyTexSubImage3DEXT parameter <target> 257 is not TEXTURE_3D_EXT. 258 259 INVALID_VALUE is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 260 parameter <level> is less than zero, or greater than the maximum value 261 supported by the implementation. 262 263 INVALID_ENUM is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 264 parameter <internalformat> is not ALPHA, RGB, RGBA, LUMINANCE, 265 LUMINANCE_ALPHA, or one of the token values defined by EXT_texture. 266 267 INVALID_VALUE is generated when any of the <width> or <height> 268 parameters of CopyTexImage1DEXT or CopyTexImage2DEXT is less than zero, 269 or if it cannot be represented as 2**k + 2*border for some integer k. 270 271 INVALID_VALUE is generated if CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, 272 or CopyTexSubImage3DEXT parameter <xoffset>, CopyTexSubImage2DEXT or 273 CopyTexSubImage3DEXT parameter <yoffset>, or CopyTexSubImage3DEXT 274 parameter <zoffset> is less than -TEXTURE_BORDER, where TEXTURE_BORDER 275 is the border width of the texture array to be modified. 276 277 INVALID_VALUE is generated if CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, 278 or CopyTexSubImage3DEXT (xoffset + width) > (TEXTURE_WIDTH - 279 TEXTURE_BORDER), or if CopyTexSubImage2DEXT or CopyTexSubImage3DEXT 280 (yoffset + height) > (TEXTURE_HEIGHT - TEXTURE_BORDER), or if 281 CopyTexSubImage3DEXT zoffset >= (TEXTURE_DEPTH_EXT - TEXTURE_BORDER). 282 Note that TEXTURE_WIDTH, TEXTURE_HEIGHT, and TEXTURE_DEPTH_EXT include 283 twice the border width. 284 285 TEXTURE_TOO_LARGE_EXT is generated by CopyTexImage1DEXT or 286 CopyTexImage2DEXT if the specified image is too large, for any reason. 287 (See EXT_texture for a discussion of how applications can query the 288 maximum texture size.) 289 290 INVALID_VALUE is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 291 parameter <border> is not 0, 1, or 2. 292 293 INVALID_OPERATION is generated if CopyTexImage1DEXT, CopyTexImage2DEXT, 294 CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, or CopyTexSubImage3DEXT is 295 called between execution of Begin and the corresponding execution of 296 End. 297 298New State 299 300 None 301 302New Implementation Dependent State 303 304 None 305