Screenshots
Hi, here is a little Yule gift for all you GL junkies out there, it’s a short quick and easy tool for taking a screen shot into the tga format, sure it’s uncompressed and doesn’t increment the file name, but it’s pretty slick.
void screenshot (char filename[160],int x, int y) { // get the image data // split x and y sizes into bytes int ya= y % 256; //assemble the header // write header and data to file delete[] data; |
Usage: screenshot (“test.tga”,800,600);
Just call the function with the correct window size just before SwapBuffers and it will take a screen shot of everything in the frame buffer, easy.