1 #ifndef GL_SCREENSHOT_PROGRAM_H 2 #define GL_SCREENSHOT_PROGRAM_H 5 #include "GLScreenshot.h" 7 #include <KrisLibrary/Timer.h> 25 template <
class BaseGUI>
29 std::string screenshotFile;
31 double lastScreenshotTime;
39 lastScreenshotTime = 0;
41 screenshotFile =
"image0000.ppm";
49 GLSaveScreenshotPPM(screenshotFile.c_str());
50 if(verbose) LOG4CXX_INFO(KrisLibrary::logger(),
"Screenshot saved to "<<screenshotFile.c_str());
56 lastScreenshotTime = 0;
67 if(saveMovie) StopMovie();
74 this->MovieUpdate(timer.ElapsedTime());
78 void MovieUpdate(
double t)
81 if(t >= lastScreenshotTime + frameTime) {
82 LOG4CXX_INFO(KrisLibrary::logger(),
"Time "<<t<<
" last "<<lastScreenshotTime<<
", Saving "<<(
int)Floor((t-lastScreenshotTime)/frameTime));
83 while(lastScreenshotTime+frameTime < t) {
85 IncrementStringDigits(screenshotFile);
86 lastScreenshotTime += frameTime;
Contains all definitions in the GLDraw package.
Definition: AnyGeometry.h:13
The logging system used in KrisLibrary.
Utilities for string manipulation.
A plugin class that "automatically" saves a movie to disk in the form of PPM screenshots.
Definition: GLScreenshotProgram.h:26