]> git.cworth.org Git - apitrace/blobdiff - glsnapshot.cpp
Fix fetching of the data for uniform arrays.
[apitrace] / glsnapshot.cpp
index 1f95db1d22408aa0a33731fe1f6a6237726ed464..e37fbccdb4594e9a13b55d96c30aa76cbf4eb144 100644 (file)
 #include <assert.h>
 #include <stdint.h>
 
+#include "os_path.hpp"
 #include "image.hpp"
 #include "glproc.hpp"
 #include "glsize.hpp"
 
 
-#if !defined(_WIN32) && !defined(__APPLE__)
+#if !defined(TRACE_EGL) && !defined(_WIN32) && !defined(__APPLE__)
 
 
 #include <X11/Xproto.h>
@@ -65,7 +66,12 @@ namespace glsnapshot {
  */
 static image::Image *
 getDrawableImage(void) {
-#if defined(_WIN32)
+#if defined(TRACE_EGL)
+
+    // TODO
+    return NULL;
+
+#elif defined(_WIN32)
 
     HDC hDC = __wglGetCurrentDC();
     if (!hDC) {
@@ -205,10 +211,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::log("apitrace: wrote %s\n", filename);
+                os::log("apitrace: wrote %s\n", filename.str());
             }
 
             delete src;