]> git.mxchange.org Git - simgear.git/blobdiff - simgear/screen/screen-dump.cxx
fix a typo
[simgear.git] / simgear / screen / screen-dump.cxx
index 47a40f224b0c1283c757b873f1490fa883ff79e6..dc5ba7bd56eb0c9310ceb620b5b0e4c8db5bb7ea 100644 (file)
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Library General Public License for more details.
 //
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA  02111-1307, USA.
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #  include <simgear_config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>                     
+#if defined(__CYGWIN__)  /* && !defined(USING_X) */
+#define WIN32
+#endif
+
+#if defined(WIN32)  /* MINGW and MSC predefine WIN32 */
+# include <windows.h>
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
 
-#include <GL/glut.h>
-#include <simgear/xgl/xgl.h>
+#include <simgear/compiler.h>
+
+#include <osg/GL>
 
 #include "screen-dump.hxx"
 
@@ -51,6 +55,7 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
     ibuffer = (unsigned char *) malloc(win_width*win_height*RGB3);
 
     if ( (fp = fopen(filename, "wb")) == NULL ) {
+       free(ibuffer);
        printf("Warning: cannot open %s\n", filename);
        return false;
     }
@@ -67,8 +72,8 @@ bool sg_glWritePPMFile(const char *filename, GLubyte *buffer, int win_width, int
     fclose(fp);
     free(ibuffer);
 
-    printf("wrote file (%d x %d pixels, %d bytes)\n",
-          win_width, win_height, RGB3*win_width*win_height);
+    printf("wrote file '%s' (%d x %d pixels, %d bytes)\n",
+          filename, win_width, win_height, RGB3*win_width*win_height);
     return true;
 }