Skip to content

Commit

Permalink
Switch viewer to dump SGIs instead of PPMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherbatty committed Feb 6, 2018
1 parent 6ae7709 commit 96c0670
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions viewpls3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ unsigned int highest_frame = 0;
bool filming = false;
bool running = false;

char * ppmfileformat;
char * sgifileformat;

std::vector<Vec3f> particles;
float particle_radius;
Expand Down Expand Up @@ -106,7 +106,7 @@ void set_lights_and_material(int object)
void timer(int value)
{
if(filming) {
Gluvi::ppm_screenshot(ppmfileformat, frame);
Gluvi::sgi_screenshot(sgifileformat, frame);
if(read_frame(frame+1)) {
if(frame == 0) {
filming = false;
Expand Down Expand Up @@ -217,7 +217,7 @@ struct ScreenShotButton : public Gluvi::Button{
ScreenShotButton(const char *label, const char *filename_format_) : Gluvi::Button(label), filename_format(filename_format_) {}
void action()
{
Gluvi::ppm_screenshot(filename_format, frame);
Gluvi::sgi_screenshot(filename_format, frame);
}
};

Expand Down Expand Up @@ -352,14 +352,14 @@ int main(int argc, char **argv)
Gluvi::StaticText frametext(frame_number.c_str());
Gluvi::root.list.push_back(&frametext);

ppmfileformat = new char[strlen(file_path.c_str())+100];
sprintf(ppmfileformat, "%sscreenshot%%04d.ppm", file_path.c_str());
printf("%s\n", ppmfileformat);
sgifileformat = new char[strlen(file_path.c_str())+100];
sprintf(sgifileformat, "%sscreenshot%%04d.sgi", file_path.c_str());
printf("%s\n", sgifileformat);

ScreenShotButton screenshot("Screenshot", ppmfileformat);
ScreenShotButton screenshot("Screenshot", sgifileformat);
Gluvi::root.list.push_back(&screenshot);

MovieButton movie("Movie", ppmfileformat);
MovieButton movie("Movie", sgifileformat);
Gluvi::root.list.push_back(&movie);

RunButton run("Run");
Expand Down

0 comments on commit 96c0670

Please sign in to comment.