X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=glretrace_main.cpp;h=d0fb5789ca314b0a22495e81bc4d2139e92e2d6c;hb=e4246254fc9472b6b0317141a464c235b38cb592;hp=52619dd211c1ed4b7376fb1cee29933a046fa64b;hpb=b3733a82424232f601867ee20311d7d4242ef1a9;p=apitrace diff --git a/glretrace_main.cpp b/glretrace_main.cpp index 52619dd..d0fb578 100644 --- a/glretrace_main.cpp +++ b/glretrace_main.cpp @@ -111,14 +111,14 @@ static void snapshot(Image::Image &image) { } -static void frame_complete(void) { +static void frame_complete(unsigned call_no) { ++frame; 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; @@ -132,19 +132,18 @@ static void frame_complete(void) { 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; } } - - ws->processEvents(); + } @@ -163,7 +162,7 @@ static void display(void) { std::cout << *call; std::cout.flush(); }; - frame_complete(); + frame_complete(call->no); if (double_buffer) drawable->swapBuffers(); else @@ -172,7 +171,7 @@ static void display(void) { name == "wglMakeCurrent") { glFlush(); if (!double_buffer) { - frame_complete(); + frame_complete(call->no); } } else { continue; @@ -182,7 +181,7 @@ static void display(void) { if (name == "glFlush") { glFlush(); if (!double_buffer) { - frame_complete(); + frame_complete(call->no); } }