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)
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