glws::Context *context = NULL;
int window_width = 256, window_height = 256;
-bool reshape_window = false;
unsigned frame = 0;
long long startTime = 0;
}
-static void frame_complete(void) {
+static void frame_complete(unsigned call_no) {
++frame;
- if (!reshape_window && (snapshot_prefix || compare_prefix)) {
+ if (snapshot_prefix || compare_prefix) {
Image::Image *ref = NULL;
if (compare_prefix) {
char filename[PATH_MAX];
- snprintf(filename, sizeof filename, "%s%04u.png", compare_prefix, frame);
+ snprintf(filename, sizeof filename, "%s%010u.png", compare_prefix, call_no);
ref = Image::readPNG(filename);
if (!ref) {
return;
if (snapshot_prefix) {
char filename[PATH_MAX];
- snprintf(filename, sizeof filename, "%s%04u.png", snapshot_prefix, frame);
+ snprintf(filename, sizeof filename, "%s%010u.png", snapshot_prefix, call_no);
if (src.writePNG(filename) && retrace::verbosity >= 0) {
std::cout << "Wrote " << filename << "\n";
}
}
if (ref) {
- std::cout << "Frame " << frame << " average precision of " << src.compare(*ref) << " bits\n";
+ std::cout << "Snapshot " << call_no << " average precision of " << src.compare(*ref) << " bits\n";
delete ref;
}
}
-
- if (reshape_window) {
- // XXX: doesn't quite work
- drawable->resize(window_width, window_height);
- reshape_window = false;
- }
- ws->processEvents();
}
std::cout << *call;
std::cout.flush();
};
- frame_complete();
+ frame_complete(call->no);
if (double_buffer)
drawable->swapBuffers();
else
name == "wglMakeCurrent") {
glFlush();
if (!double_buffer) {
- frame_complete();
+ frame_complete(call->no);
}
} else {
continue;
if (name == "glFlush") {
glFlush();
if (!double_buffer) {
- frame_complete();
+ frame_complete(call->no);
}
}