From: Anders W. <and...@gm...> - 2009-10-19 20:23:51
|
It turns out the command 'scrot' works better on my system, it takes a screenshot of the whole screen. I could then batch-process each file to crop the visual window and then assemble into a movie. But all of this seems like a lot of trouble when the c-code to do a screenshot using SDL/OpenGL is something like: void Screendump(char *destFile, short W, short H) { FILE *out = fopen(destFile, "w"); char pixel_data[3*W*H]; short TGAhead[] = {0, 2, 0, 0, 0, 0, W, H, 24}; glReadBuffer(GL_FRONT); 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); } Could this perhaps be wrapped as a separate python extension and would it then work with visual?? |