PDA

View Full Version : Copy display buffer to texture



07-03-2001, 03:33 AM
I want to copy the contents of the display buffer to texture memory. So I can draw it back again with filtering, zoom and rotation. How do I do this ?

Thank for any help Mike

witcomb
07-03-2001, 01:39 PM
You can read the entire colour buffer, with the read pixels function.

Create a buffer the size of you screen.
unsigned char *image[width*height*3];
then read the pixels
glReadPixels(0,0,w,h,GL_RGB,GL_UNSIGNED_BYTE,image );
That should do it, take a look at this function, though it is what you want I may have something slightly wrong.

Neil

Nutty
07-03-2001, 02:05 PM
If you want speed, you're probably better using glTexCopySubImage.