cleanups. and restore accidentally deleted old system-gl.h

felipesanches-svg
don bright 2013-01-26 23:18:31 +01:00
parent c133ae3b7d
commit f17a282220
9 changed files with 14 additions and 66 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -70,15 +70,6 @@ void cgalTree(Tree &tree)
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::options_description desc("Allowed options");

View File

@ -70,15 +70,6 @@ void cgalTree(Tree &tree)
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
{
OffscreenView *glview;

View File

@ -69,15 +69,6 @@ void cgalTree(Tree &tree)
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 retval = 0;

View File

@ -65,15 +65,6 @@ void cgalTree(Tree &tree)
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)
{
if (argc != 2) {

View File

@ -65,15 +65,6 @@ CsgInfo::CsgInfo() {
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)
{
assert(glview);