]> git.cworth.org Git - apitrace/blobdiff - glretrace_main.cpp
Return format info for both textures and framebuffers.
[apitrace] / glretrace_main.cpp
index 9def1c68d157c6ed65e93cabd3f09c6a6106f094..dfb051c6a352b216ba47eea89c1386c48741b076 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <string.h>
 
+#include "os_path.hpp"
 #include "image.hpp"
 #include "retrace.hpp"
 #include "glproc.hpp"
@@ -139,8 +140,7 @@ void snapshot(unsigned call_no) {
     image::Image *ref = NULL;
 
     if (compare_prefix) {
-        char filename[PATH_MAX];
-        snprintf(filename, sizeof filename, "%s%010u.png", compare_prefix, call_no);
+        os::Path filename = os::Path::format("%s%010u.png", compare_prefix, call_no);
         ref = image::readPNG(filename);
         if (!ref) {
             return;
@@ -161,8 +161,7 @@ void snapshot(unsigned call_no) {
             snprintf(comment, sizeof comment, "%u", call_no);
             src->writePNM(std::cout, comment);
         } else {
-            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) && retrace::verbosity >= 0) {
                 std::cout << "Wrote " << filename << "\n";
             }
@@ -203,8 +202,9 @@ static void display(void) {
     retracer.addCallbacks(glx_callbacks);
     retracer.addCallbacks(wgl_callbacks);
     retracer.addCallbacks(cgl_callbacks);
+    retracer.addCallbacks(egl_callbacks);
 
-    startTime = os::GetTime();
+    startTime = os::getTime();
     trace::Call *call;
 
     while ((call = parser.parse_call())) {
@@ -223,7 +223,7 @@ static void display(void) {
     // Reached the end of trace
     glFlush();
 
-    long long endTime = os::GetTime();
+    long long endTime = os::getTime();
     float timeInterval = (endTime - startTime) * 1.0E-6;
 
     if (retrace::verbosity >= -1) {