diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fbo.cc | 2 | ||||
-rw-r--r-- | src/imageutils-lodepng.cc | 6 | ||||
-rw-r--r-- | src/mainwin.cc | 9 | ||||
-rw-r--r-- | src/system-gl.h | 18 |
4 files changed, 14 insertions, 21 deletions
@@ -59,7 +59,7 @@ bool check_fbo_status() else if (status == GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT) cerr << "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\n"; else - cerr << "Unknown Code: glCheckFramebufferStatusEXT returned:" <<status <<"\n"; + cerr << "Unknown Code: glCheckFramebufferStatusEXT returned:" << status <<"\n"; return result; } diff --git a/src/imageutils-lodepng.cc b/src/imageutils-lodepng.cc index fab1cd9..a034702 100644 --- a/src/imageutils-lodepng.cc +++ b/src/imageutils-lodepng.cc @@ -8,17 +8,19 @@ bool write_png(std::ostream &output, unsigned char *pixels, int width, int heigh //encoder.settings.zlibsettings.windowSize = 2048; //LodePNG_Text_add(&encoder.infoPng.text, "Comment", "Created with LodePNG"); size_t dataout_size = -1; + bool result = false; unsigned char *dataout = (unsigned char *)malloc(width*height*4); if (!dataout) { perror("Error allocating memory while writing png\n"); - return false; + return result; } LodePNG_encode(&dataout, &dataout_size, pixels, width, height, LCT_RGBA, 8); try { output.write( reinterpret_cast<const char*>(dataout), dataout_size ); + result = true; } catch (const std::ios_base::failure &e) { std::cerr << "Error writing to ostream:" << e.what() << "\n"; } free( dataout ); - return true; + return result; } diff --git a/src/mainwin.cc b/src/mainwin.cc index d596186..cf79b5a 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -576,15 +576,6 @@ void MainWindow::refreshDocument() setCurrentOutput(); } -/*AbstractNode *MainWindow::find_root_tag(AbstractNode *n) -{ - BOOST_FOREACH (AbstractNode *v, n->children) { - if (v->modinst->isRoot()) return v; - if (AbstractNode *vroot = find_root_tag(v)) return vroot; - } - return NULL; -}*/ - /*! Parse and evaluate the design => this->root_node diff --git a/src/system-gl.h b/src/system-gl.h index dd465f6..d7de3c6 100644 --- a/src/system-gl.h +++ b/src/system-gl.h @@ -1,16 +1,16 @@ #ifndef SYSTEMGL_H_ #define SYSTEMGL_H_ -#ifdef _WIN32 -// Prevent obtuse compile errors on Win32/mingw32. This is related -// GLU Tessellation callback definitions, and how glew deals with them. -#include <windows.h> -#endif - #include <GL/glew.h> -#include <string> -std::string glew_dump(bool dumpall=false); -bool report_glerror(const char *task); +#ifdef __APPLE__ + #include <OpenGL/OpenGL.h> +#else + #include <GL/gl.h> + #include <GL/glu.h> + #ifdef _WIN32 + #include <windows.h> // For the CALLBACK macro + #endif +#endif #endif |