mirror of https://github.com/vitalif/openscad
cleanups. and restore accidentally deleted old system-gl.h
parent
c133ae3b7d
commit
f17a282220
|
@ -59,7 +59,7 @@ bool check_fbo_status()
|
||||||
else if (status == GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT)
|
else if (status == GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT)
|
||||||
cerr << "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\n";
|
cerr << "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\n";
|
||||||
else
|
else
|
||||||
cerr << "Unknown Code: glCheckFramebufferStatusEXT returned:" <<status <<"\n";
|
cerr << "Unknown Code: glCheckFramebufferStatusEXT returned:" << status <<"\n";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,17 +8,19 @@ bool write_png(std::ostream &output, unsigned char *pixels, int width, int heigh
|
||||||
//encoder.settings.zlibsettings.windowSize = 2048;
|
//encoder.settings.zlibsettings.windowSize = 2048;
|
||||||
//LodePNG_Text_add(&encoder.infoPng.text, "Comment", "Created with LodePNG");
|
//LodePNG_Text_add(&encoder.infoPng.text, "Comment", "Created with LodePNG");
|
||||||
size_t dataout_size = -1;
|
size_t dataout_size = -1;
|
||||||
|
bool result = false;
|
||||||
unsigned char *dataout = (unsigned char *)malloc(width*height*4);
|
unsigned char *dataout = (unsigned char *)malloc(width*height*4);
|
||||||
if (!dataout) {
|
if (!dataout) {
|
||||||
perror("Error allocating memory while writing png\n");
|
perror("Error allocating memory while writing png\n");
|
||||||
return false;
|
return result;
|
||||||
}
|
}
|
||||||
LodePNG_encode(&dataout, &dataout_size, pixels, width, height, LCT_RGBA, 8);
|
LodePNG_encode(&dataout, &dataout_size, pixels, width, height, LCT_RGBA, 8);
|
||||||
try {
|
try {
|
||||||
output.write( reinterpret_cast<const char*>(dataout), dataout_size );
|
output.write( reinterpret_cast<const char*>(dataout), dataout_size );
|
||||||
|
result = true;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
std::cerr << "Error writing to ostream:" << e.what() << "\n";
|
std::cerr << "Error writing to ostream:" << e.what() << "\n";
|
||||||
}
|
}
|
||||||
free( dataout );
|
free( dataout );
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -576,15 +576,6 @@ void MainWindow::refreshDocument()
|
||||||
setCurrentOutput();
|
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
|
Parse and evaluate the design => this->root_node
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
#ifndef SYSTEMGL_H_
|
#ifndef SYSTEMGL_H_
|
||||||
#define 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 <GL/glew.h>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
std::string glew_dump(bool dumpall=false);
|
#ifdef __APPLE__
|
||||||
bool report_glerror(const char *task);
|
#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
|
#endif
|
||||||
|
|
|
@ -70,15 +70,6 @@ void cgalTree(Tree &tree)
|
||||||
evaluate.execute();
|
evaluate.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*AbstractNode *find_root_tag(AbstractNode *n)
|
|
||||||
{
|
|
||||||
foreach(AbstractNode *v, n->children) {
|
|
||||||
if (v->modinst->tag_root) return v;
|
|
||||||
if (AbstractNode *vroot = find_root_tag(v)) return vroot;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
po::variables_map parse_options(int argc, char *argv[])
|
po::variables_map parse_options(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
po::options_description desc("Allowed options");
|
po::options_description desc("Allowed options");
|
||||||
|
|
|
@ -70,15 +70,6 @@ void cgalTree(Tree &tree)
|
||||||
evaluate.execute();
|
evaluate.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*AbstractNode *find_root_tag(AbstractNode *n)
|
|
||||||
{
|
|
||||||
foreach(AbstractNode *v, n->children) {
|
|
||||||
if (v->modinst->tag_root) return v;
|
|
||||||
if (AbstractNode *vroot = find_root_tag(v)) return vroot;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
struct CsgInfo
|
struct CsgInfo
|
||||||
{
|
{
|
||||||
OffscreenView *glview;
|
OffscreenView *glview;
|
||||||
|
|
|
@ -69,15 +69,6 @@ void cgalTree(Tree &tree)
|
||||||
evaluate.execute();
|
evaluate.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*AbstractNode *find_root_tag(AbstractNode *n)
|
|
||||||
{
|
|
||||||
foreach(AbstractNode *v, n->children) {
|
|
||||||
if (v->modinst->tag_root) return v;
|
|
||||||
if (AbstractNode *vroot = find_root_tag(v)) return vroot;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
|
@ -65,15 +65,6 @@ void cgalTree(Tree &tree)
|
||||||
evaluate.execute();
|
evaluate.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*AbstractNode *find_root_tag(AbstractNode *n)
|
|
||||||
{
|
|
||||||
foreach(AbstractNode *v, n->children) {
|
|
||||||
if (v->modinst->tag_root) return v;
|
|
||||||
if (AbstractNode *vroot = find_root_tag(v)) return vroot;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
|
|
|
@ -65,15 +65,6 @@ CsgInfo::CsgInfo() {
|
||||||
glview = NULL;
|
glview = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*AbstractNode *find_root_tag(AbstractNode *n)
|
|
||||||
{
|
|
||||||
foreach(AbstractNode *v, n->children) {
|
|
||||||
if (v->modinst->tag_root) return v;
|
|
||||||
if (AbstractNode *vroot = find_root_tag(v)) return vroot;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
string info_dump(OffscreenView *glview)
|
string info_dump(OffscreenView *glview)
|
||||||
{
|
{
|
||||||
assert(glview);
|
assert(glview);
|
||||||
|
|
Loading…
Reference in New Issue