*/
#include <algorithm>
+#include <stdexcept>
#include <png.h>
-#include <msp/io/print.h>
#include "arraysize.h"
#include "breakpoint.h"
#include "functions.h"
#include "gldbg.h"
#include "grabber.h"
+#include "strformat.h"
using namespace std;
-using namespace Msp;
Grabber::Grabber(GlDbg &g):
gldbg(g),
}
}
else
- throw InvalidParameterValue("Invalid autograb mode");
+ throw runtime_error("Invalid autograb mode");
}
void Grabber::grab()
{
Grabber *self = reinterpret_cast<Grabber *>(user_data);
- string fn = Msp::format("grab-%04d-%04d.png", self->frame_num, self->grab_num);
+ string fn = strformat("grab-%04d-%04d.png", self->frame_num, self->grab_num);
if(format==GL_RGBA && type==GL_UNSIGNED_BYTE)
{
if(self->write_png(fn, width, height, data)<0)
- IO::print("Failed to write png file %s\n", fn);
+ printf("Failed to write png file %s\n", fn.c_str());
else
- IO::print("Grabbed %dx%d png image to %s\n", width, height, fn);
+ printf("Grabbed %dx%d png image to %s\n", width, height, fn.c_str());
}
++self->grab_num;