Textures from Frame Buffer

Normally, a texture is defined using data in main memory - an image that was read from a file, or created algorithmically.

It is also possible to take image data from the frame buffer and load it into a texture.

glCopyTexImage2D(GL_TEXTURE_2D, 0,
                 GL_RGB, x, y,
                 width, height, 0)

copies data from part of the frame buffer into the active texture.

With this, we can create a "virtual camera".

Example: copytex.py