diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/OffscreenContext.h | 1 | ||||
-rw-r--r-- | src/OffscreenContextAll.hpp | 6 | ||||
-rw-r--r-- | src/OffscreenContextCGL.mm | 2 | ||||
-rw-r--r-- | src/OffscreenContextGLX.cc | 1 | ||||
-rw-r--r-- | src/imageutils-macosx.cc | 1 | ||||
-rw-r--r-- | src/imageutils.cc | 2 | ||||
-rw-r--r-- | src/openscad.cc | 2 |
7 files changed, 7 insertions, 8 deletions
diff --git a/src/OffscreenContext.h b/src/OffscreenContext.h index 0c700b6..3fd8921 100644 --- a/src/OffscreenContext.h +++ b/src/OffscreenContext.h @@ -5,7 +5,6 @@ // Objective-C with C++, it is a bit different than what's found in a textbook. #include <iostream> -#include <fstream> #include <string> #include "fbo.h" diff --git a/src/OffscreenContextAll.hpp b/src/OffscreenContextAll.hpp index 1c73b73..b0df83d 100644 --- a/src/OffscreenContextAll.hpp +++ b/src/OffscreenContextAll.hpp @@ -1,5 +1,5 @@ -// Functions shared by OffscreenContext[platform].cc (or .mm) -// #include directly after definition of struct OffscreenContext. +// Functions shared by OffscreenContext[platform].cc +// #include this directly after definition of struct OffscreenContext. void bind_offscreen_context(OffscreenContext *ctx) { @@ -11,7 +11,7 @@ void bind_offscreen_context(OffscreenContext *ctx) */ bool save_framebuffer(OffscreenContext *ctx, const char *filename) { - std::ofstream fstream(filename); + std::ofstream fstream(filename,std::ios::out|std::ios::binary); if (!fstream.is_open()) { std::cerr << "Can't open file " << filename << " for writing"; return false; diff --git a/src/OffscreenContextCGL.mm b/src/OffscreenContextCGL.mm index c6d76ab..ab3cc1b 100644 --- a/src/OffscreenContextCGL.mm +++ b/src/OffscreenContextCGL.mm @@ -113,7 +113,7 @@ bool teardown_offscreen_context(OffscreenContext *ctx) */ bool save_framebuffer(OffscreenContext *ctx, const char *filename) { - std::ofstream fstream(filename); + std::ofstream fstream(filename,std::ios::out|std::ios::binary); if (!fstream.is_open()) { PRINTB("Can't open file \"%s\" for writing", filename); return false; diff --git a/src/OffscreenContextGLX.cc b/src/OffscreenContextGLX.cc index ef26ce7..84bcf0e 100644 --- a/src/OffscreenContextGLX.cc +++ b/src/OffscreenContextGLX.cc @@ -45,7 +45,6 @@ See Also #include <GL/glx.h> #include <assert.h> -#include <fstream> #include <sstream> #include <sys/utsname.h> // for uname diff --git a/src/imageutils-macosx.cc b/src/imageutils-macosx.cc index 5236b76..2fcdb93 100644 --- a/src/imageutils-macosx.cc +++ b/src/imageutils-macosx.cc @@ -1,6 +1,7 @@ #include <ApplicationServices/ApplicationServices.h> #include <CGDataConsumer.h> #include "imageutils.h" +#include <assert.h> CGDataConsumerCallbacks dc_callbacks; diff --git a/src/imageutils.cc b/src/imageutils.cc index eaab3b7..133eaf1 100644 --- a/src/imageutils.cc +++ b/src/imageutils.cc @@ -11,7 +11,7 @@ void flip_image(const unsigned char *src, unsigned char *dst, size_t pixelsize, } bool write_png(const char *filename, unsigned char *pixels, int width, int height) { - std::ofstream fstream( filename ); + std::ofstream fstream( filename, std::ios::binary ); if (fstream.is_open()) { write_png( fstream, pixels, width, height ); fstream.close(); diff --git a/src/openscad.cc b/src/openscad.cc index f796136..0770558 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -386,7 +386,7 @@ int main(int argc, char **argv) } if (png_output_file) { - std::ofstream fstream(png_output_file); + std::ofstream fstream(png_output_file,std::ios::out|std::ios::binary); if (!fstream.is_open()) { PRINTB("Can't open file \"%s\" for export", png_output_file); } |