X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscreen%2Fscreen-dump.cxx;h=ecea865933dae8f7a7e363bd0e5f8620f4261bde;hb=33970663435dd1a12941b017739285341205acf4;hp=e4e97106b12934ab94fa15a2885f1ff62607fbb9;hpb=11479cd8c386d8bf7e1fee7bed60ab4abefc5fad;p=simgear.git diff --git a/simgear/screen/screen-dump.cxx b/simgear/screen/screen-dump.cxx index e4e97106..ecea8659 100644 --- a/simgear/screen/screen-dump.cxx +++ b/simgear/screen/screen-dump.cxx @@ -23,11 +23,7 @@ # include #endif -#if defined(__CYGWIN__) /* && !defined(USING_X) */ -#define WIN32 -#endif - -#if defined(WIN32) /* MINGW and MSC predefine WIN32 */ +#ifdef WIN32 # include #endif @@ -79,11 +75,10 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int } -// dump the screen buffer to a png file +// dump the screen buffer to a png file, returns true on success bool sg_glDumpWindow(const char *filename, int win_width, int win_height) { osg::ref_ptr img(new osg::Image); img->readPixels(0,0, win_width, win_height, GL_RGB, GL_UNSIGNED_BYTE); - osgDB::writeImageFile(*img, filename); - return true; + return osgDB::writeImageFile(*img, filename); }