diff --git a/src/export.cpp b/src/export.cpp index 6bfb4b5..38d7642 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -7,6 +7,9 @@ // Copyright 2008-2013 Jonathan Westhues. //----------------------------------------------------------------------------- #include "solvespace.h" +#ifndef WIN32 +#include +#endif #include void SolveSpaceUI::ExportSectionTo(const std::string &filename) { @@ -1048,6 +1051,10 @@ void SolveSpaceUI::ExportAsPngTo(const std::string &filename) { // so repaint the scene. And hide the toolbar too. bool prevShowToolbar = SS.showToolbar; SS.showToolbar = false; +#ifndef WIN32 + std::unique_ptr gloffscreen(new GLOffscreen); + gloffscreen->begin(w, h); +#endif SS.GW.Paint(); SS.showToolbar = prevShowToolbar; diff --git a/src/solvespace.h b/src/solvespace.h index d5ba6ac..c52733a 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/src/unix/gloffscreen.cpp b/src/unix/gloffscreen.cpp index 107721f..be836e2 100644 --- a/src/unix/gloffscreen.cpp +++ b/src/unix/gloffscreen.cpp @@ -27,6 +27,8 @@ GLOffscreen::GLOffscreen() : _pixels(NULL), _pixels_inv(NULL), _width(0), _heigh } GLOffscreen::~GLOffscreen() { + delete[] _pixels; + delete[] _pixels_inv; glDeleteRenderbuffersEXT(1, &_depth_renderbuffer); glDeleteRenderbuffersEXT(1, &_color_renderbuffer); glDeleteFramebuffersEXT(1, &_framebuffer);