#define RTLD_NEXT ((void *) -1l)
#endif
-static char buf[640 * 480 * 3];
+#define WIDTH 640
+#define HEIGHT 480
+
+static char buf[WIDTH * HEIGHT * 3];
static int frameno = 0;
void glXSwapBuffers( Display *dpy, GLXDrawable drawable )
FILE *ppm;
char filename[256];
- glReadPixels(0, 0, 640, 480, GL_RGB, GL_UNSIGNED_BYTE, buf);
+ glReadPixels(0, 0, WIDTH, HEIGHT, GL_RGB, GL_UNSIGNED_BYTE, buf);
sprintf(filename, "frame%05u.ppm", frameno++);
ppm = fopen(filename, "w");
- fprintf(ppm, "P6\n640 480\n255\n");
- fwrite(buf, 640*480*3, 1, ppm);
+ fprintf(ppm, "P6\nWIDTH HEIGHT\n255\n");
+ fwrite(buf, WIDTH*HEIGHT*3, 1, ppm);
fclose(ppm);
real_swap(dpy, drawable);