mesa: make _mesa_write_renderbuffer_image() non-static
authorBrian Paul <brianp@vmware.com>
Tue, 15 Feb 2011 17:26:56 +0000 (10:26 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 17 Feb 2011 00:07:02 +0000 (17:07 -0700)
src/mesa/main/debug.c
src/mesa/main/debug.h

index c1118504f9266a53b37307b9e137af050f318688..f5bfccc01dc3ba20b10974203a1db5e3c536ff9c 100644 (file)
@@ -306,8 +306,8 @@ write_texture_image(struct gl_texture_object *texObj,
 /**
  * Write renderbuffer image to a ppm file.
  */
-static void
-write_renderbuffer_image(const struct gl_renderbuffer *rb)
+void
+_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb)
 {
    GET_CURRENT_CONTEXT(ctx);
    GLubyte *buffer;
@@ -324,6 +324,10 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb)
       type = GL_UNSIGNED_INT_24_8;
    }
    else {
+      _mesa_debug(NULL,
+                  "Unsupported BaseFormat 0x%x in "
+                  "_mesa_write_renderbuffer_image()\n",
+                  rb->_BaseFormat);
       return;
    }
 
@@ -334,8 +338,12 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb)
 
    /* make filename */
    _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name);
+   _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name);
 
    printf("  Writing renderbuffer image to %s\n", s);
+
+   _mesa_debug(NULL, "  Writing renderbuffer image to %s\n", s);
+
    write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE);
 
    free(buffer);
@@ -422,7 +430,7 @@ dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage)
          rb->Name, rb->Width, rb->Height,
          _mesa_lookup_enum_by_nr(rb->InternalFormat));
    if (writeImage) {
-      write_renderbuffer_image(rb);
+      _mesa_write_renderbuffer_image(rb);
    }
 }
 
index 17aa897e8d121443252ae6d4f84161419e054a59..4968a9f197911419b866b28e022e3d00337268e7 100644 (file)
@@ -63,6 +63,9 @@ extern void _mesa_init_debug( struct gl_context *ctx );
 
 #endif
 
+extern void
+_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb);
+
 extern void
 _mesa_dump_texture(GLuint texture, GLuint writeImages);