summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-01-24 03:10:24 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-01-24 03:10:24 (GMT)
commit009baca90428399d4e3540bff18510ef51a28454 (patch)
treec4e377bae63557c060718557186a7484b922edcc
parente7ea8e12a933849bc6cb9efda5fbb2ac6ddbccab (diff)
move imageutils platform stuff to qmake build file mv system-gl. fix gcc warning
-rw-r--r--openscad.pro5
-rw-r--r--src/fbo.cc2
-rw-r--r--src/imageutils-lodepng.cc1
-rw-r--r--src/imageutils.cc6
-rw-r--r--src/system-gl.h12
-rw-r--r--tests/system-gl.cc50
-rw-r--r--tests/system-gl.h10
7 files changed, 9 insertions, 77 deletions
diff --git a/openscad.pro b/openscad.pro
index 1edf97c..c79551e 100644
--- a/openscad.pro
+++ b/openscad.pro
@@ -235,7 +235,8 @@ HEADERS += src/version_check.h \
src/OffscreenContext.h \
src/OffscreenView.h \
src/fbo.h \
- src/imageutils.h
+ src/imageutils.h \
+ src/system-gl.h
SOURCES += src/version_check.cc \
src/ProgressWidget.cc \
@@ -295,6 +296,8 @@ SOURCES += src/version_check.cc \
src/svg.cc \
src/OffscreenView.cc \
src/fbo.cc \
+ src/system-gl.cc \
+ src/imageutils.cc \
\
src/openscad.cc \
src/mainwin.cc
diff --git a/src/fbo.cc b/src/fbo.cc
index a6677c1..e12c295 100644
--- a/src/fbo.cc
+++ b/src/fbo.cc
@@ -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 %i\n",status;
+ cerr << "Unknown Code: glCheckFramebufferStatusEXT returned:" <<status <<"\n";
return result;
}
diff --git a/src/imageutils-lodepng.cc b/src/imageutils-lodepng.cc
index 8460d9e..c89ed7c 100644
--- a/src/imageutils-lodepng.cc
+++ b/src/imageutils-lodepng.cc
@@ -1,5 +1,6 @@
#include "lodepng.h"
#include <stdio.h>
+#include <stdlib.h>
bool write_png(const char *filename, unsigned char *pixels, int width, int height)
{
diff --git a/src/imageutils.cc b/src/imageutils.cc
index e15ba2b..7ee14e9 100644
--- a/src/imageutils.cc
+++ b/src/imageutils.cc
@@ -8,9 +8,3 @@ void flip_image(const unsigned char *src, unsigned char *dst, size_t pixelsize,
memmove(dst + (height - i - 1) * rowBytes, src + i * rowBytes, rowBytes);
}
}
-
-#ifdef __APPLE__
-#include "imageutils-macosx.cc"
-#else
-#include "imageutils-lodepng.cc"
-#endif
diff --git a/src/system-gl.h b/src/system-gl.h
index d7de3c6..4a8ccac 100644
--- a/src/system-gl.h
+++ b/src/system-gl.h
@@ -2,15 +2,9 @@
#define SYSTEMGL_H_
#include <GL/glew.h>
+#include <string>
-#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
+std::string glew_dump(bool dumpall=false);
+bool report_glerror(const char *task);
#endif
diff --git a/tests/system-gl.cc b/tests/system-gl.cc
deleted file mode 100644
index 2e3f3bc..0000000
--- a/tests/system-gl.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-
-/* OpenGL helper functions */
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include "system-gl.h"
-#include <boost/algorithm/string.hpp>
-
-using namespace std;
-using namespace boost;
-
-string glew_dump(bool dumpall)
-{
- stringstream out;
- out << "GLEW version: " << glewGetString(GLEW_VERSION) << endl
- << "GL Renderer: " << (const char *)glGetString(GL_RENDERER) << endl
- << "GL Vendor: " << (const char *)glGetString(GL_VENDOR) << endl
- << "OpenGL Version: " << (const char *)glGetString(GL_VERSION) << endl;
-
- out << "GL Extensions: " << endl;
- if (dumpall) {
- string extensions((const char *)glGetString(GL_EXTENSIONS));
- replace_all( extensions, " ", "\n " );
- out << " " << extensions << endl;
- }
-
- out << "GL_ARB_framebuffer_object: "
- << (glewIsSupported("GL_ARB_framebuffer_object") ? "yes" : "no")
- << endl
- << "GL_EXT_framebuffer_object: "
- << (glewIsSupported("GL_EXT_framebuffer_object") ? "yes" : "no")
- << endl
- << "GL_EXT_packed_depth_stencil: "
- << (glewIsSupported("GL_EXT_packed_depth_stencil") ? "yes" : "no")
- << endl;
-
- return out.str();
-};
-
-bool report_glerror(const char * function)
-{
- GLenum tGLErr = glGetError();
- if (tGLErr != GL_NO_ERROR) {
- cerr << "OpenGL error 0x" << hex << tGLErr << ": " << gluErrorString(tGLErr) << " after " << function << endl;
- return true;
- }
- return false;
-}
-
diff --git a/tests/system-gl.h b/tests/system-gl.h
deleted file mode 100644
index 4a8ccac..0000000
--- a/tests/system-gl.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef SYSTEMGL_H_
-#define SYSTEMGL_H_
-
-#include <GL/glew.h>
-#include <string>
-
-std::string glew_dump(bool dumpall=false);
-bool report_glerror(const char *task);
-
-#endif
contact: Jan Huwald // Impressum