[ODE] capturing individual frames
Alon Levy
alonl at techunix.technion.ac.il
Thu Jan 3 08:21:01 2002
please add this to the code. It's a small addition to drawstuff to enable capturing of
single frames, and with that the user can do whatever, like capturing every 5 frames instead of
every frame.
I don't know how to use diff, so here is the code. There are 3 files to change: windows.cpp, x11.cpp
and drawstuff.h .
* in windows.cpp (no support for capturing, so this is just to let the program compile smoothly in
windows and in x11)
\\\\ paste after: static HWND main_window = 0;
static int writeframes=0; // 1 if frame files to be written
static void setWriteFrames() { writeframes = 1; };
static void clearWriteFrames() { writeframes = 0; };
static void toggleWriteFrames() { writeframes ^= 1; };
* in x11.cpp
\\\\\ paste after: static in writeframes=0;
static void setWriteFrames() { writeframes = 1; };
static void clearWriteFrames() { writeframes = 0; };
static void toggleWriteFrames() { writeframes ^= 1; };
* in drawstuff.h (add at the end)
void setWriteFrames();
void clearWriteFrames();
void toggleWriteFrames();