mirror of https://github.com/vitalif/openscad
move imageutils platform stuff to qmake build file mv system-gl. fix gcc warning
parent
e7ea8e12a9
commit
009baca904
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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
|
Loading…
Reference in New Issue