fix audio big btn replay, new proj path, proxy fix, updated Features5
[goodguy/history.git] / cinelerra-5.1 / guicast / bctexture.C
index d9bc92d94869d67e314cc907d0495f3b8d16be27..b527b4e137327ab853a7528958907338d30b56d2 100644 (file)
@@ -227,7 +227,20 @@ void BC_Texture::bind(int texture_unit)
 #endif
 }
 
-void write_ppm(uint8_t *tp, int w, int h, const char *fmt, ...);
+#ifdef HAVE_GL
+static void write_ppm(uint8_t *tp, int w, int h, const char *fmt, ...)
+{
+  va_list ap;    va_start(ap, fmt);
+  char fn[256];  vsnprintf(fn, sizeof(fn), fmt, ap);
+  va_end(ap);
+  FILE *fp = !strcmp(fn,"-") ? stdout : fopen(fn,"w");
+  if( fp ) {
+    fprintf(fp,"P6\n%d %d\n255\n",w,h);
+    fwrite(tp,3*w,h,fp);
+    if( fp != stdout ) fclose(fp);
+  }
+}
+#endif
 
 void BC_Texture::write_tex(const char *fn)
 {