]> git.cworth.org Git - apitrace/blobdiff - glsnapshot.cpp
Add new "apitrace diff-state" command
[apitrace] / glsnapshot.cpp
index 2e69062974b6b7c493710ef379354bdb3117283e..97bf77e8bf635057cd18ff4855c5dda33a97939d 100644 (file)
@@ -27,6 +27,7 @@
 #include <assert.h>
 #include <stdint.h>
 
+#include "os_path.hpp"
 #include "image.hpp"
 #include "glproc.hpp"
 #include "glsize.hpp"
@@ -160,7 +161,7 @@ getDrawableImage(void) {
             }
         }
     } else {
-        os::DebugMessage("apitrace: unexpected XImage: "
+        os::log("apitrace: unexpected XImage: "
                          "bits_per_pixel = %i, "
                          "depth = %i, "
                          "red_mask = 0x%08lx, "
@@ -205,10 +206,9 @@ void snapshot(unsigned call_no) {
     if (snapshot_prefix) {
         image::Image *src = getDrawableImage();
         if (src) {
-            char filename[PATH_MAX];
-            snprintf(filename, sizeof filename, "%s%010u.png", snapshot_prefix, call_no);
+            os::Path filename = os::Path::format("%s%010u.png", snapshot_prefix, call_no);
             if (src->writePNG(filename)) {
-                os::DebugMessage("apitrace: wrote %s\n", filename);
+                os::log("apitrace: wrote %s\n", filename.str());
             }
 
             delete src;