Next | Prev | Up | Top | Contents | Index
Copying Texture Images
The functions glCopyTexImage1DEXT() and glCopyTexImage2DEXT() copy image data from the color buffer specified by the current read buffer rather than accepting image data from host memory.
To copy an image from the framebuffer, call glCopyTexImage2DEXT(), glCopyTexImage1DEXT(), glCopyTexSubImage1DEXT(), or glCopyTexSubImage2DEXT(). The prototypes for the four functions are very similar; here's glCopyTexImage2DEXT() as an example:
void glCopyTexImage2DEXT( GLenum target,GLint level,GLenum internalformat,
GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
- target and level are equivalent to their glTexImage2D() counterparts, except that target does not accept GL_PROXY_TEXTURE_2D_EXT.
- internalformat is identical to the components parameter of glTexImage2D(), except that glCopyTexImage2DEXT() does not accept the values 1, 2, 3, and 4 but instead the internal formats defined by the texture extension, some of which are listed in Table 6-1. For complete information, see the reference page.
- Each function reads image data from a color buffer region that is (width+2*border_pixel) wide and (height+2*border_pixel) high, and whose lower-left pixel has window coordinates x,y.
The pixel values are processed exactly as if glCopyPixels() had been called, but the process stops just before final conversion, that is, before clamping and conversion to fragments. At this point all pixel component values are clamped to [0,1], and then treated exactly as if the corresponding glTexImage*() or glTexSubImage*() had been called. Pixel ordering is such that lower x screen coordinates correspond to lower i (horizontal) texture coordinates, and lower y screen coordinates correspond to lower j (vertical) texture coordinates.
If the subtexture extension and the 3D texture extension are both supported, you can also use glCopyTexSubImage3DEXT(). See "The 3D Texture Extension" for more information about 3D textures.
Next | Prev | Up | Top | Contents | Index