capturing opengl programs

does anyone know how to capture an opengl program? I want to make a movie from my program but do not know how! I can use Linux or Windows, so explain how to do it on which ever one you may know.


here’s how to create a tga image:

void Screendump(char *tga_file, short W, short H) {
 FILE   *out = fopen(tga_file, "w");
 char   pixel_data[3*W*H];
 short  TGAhead[] = {0, 2, 0, 0, 0, 0, W, H, 24};

 glReadPixels(0, 0, W, H, GL_BGR, GL_UNSIGNED_BYTE, pixel_data);
 fwrite(&TGAhead, sizeof(TGAhead), 1, out);
 fwrite(pixel_data, 3*W*H, 1, out);
 fclose(out); }

download mplayer for linux; there’s a tool included- mencoder- which creates a movie from a series of images. i think it can even create divx format.

Check out FRAPS. It’s popularly used to capture output from World of Warcraft, so it might help out what you’re trying to do…