summaryrefslogtreecommitdiff
path: root/tests/opencsgtest.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-08-01 23:43:29 (GMT)
committerMarius Kintel <marius@kintel.net>2011-08-01 23:43:29 (GMT)
commit0846b4c2ea2eefa643917c928035fd34abf5126f (patch)
tree14d177f1b47e620b727dfc2166aa33ef083555fb /tests/opencsgtest.cc
parent8dc35b539b996de45ef51db1635b4de8d6ba9244 (diff)
Minor updates. This works now, but needs a bugfix in OpenCSG
Diffstat (limited to 'tests/opencsgtest.cc')
-rw-r--r--tests/opencsgtest.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/opencsgtest.cc b/tests/opencsgtest.cc
index 4d69650..7da15e8 100644
--- a/tests/opencsgtest.cc
+++ b/tests/opencsgtest.cc
@@ -1,3 +1,4 @@
+#include <GL/glew.h>
#include "openscad.h"
#include "builtin.h"
#include "context.h"
@@ -10,9 +11,9 @@
#include "PolySetCGALEvaluator.h"
#include "OpenCSGRenderer.h"
+#include "ThrownTogetherRenderer.h"
#include "csgterm.h"
-#include <GL/glew.h>
#include "OffscreenView.h"
#include <QApplication>
@@ -207,7 +208,7 @@ int main(int argc, char *argv[])
QDir::setCurrent(original_path.absolutePath());
- csgInfo.glview = new OffscreenView(256, 256);
+ csgInfo.glview = new OffscreenView(512,512);
glewInit();
cout << "GLEW version " << glewGetString(GLEW_VERSION) << "\n";
@@ -227,19 +228,14 @@ int main(int argc, char *argv[])
}
OpenCSGRenderer opencsgRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain, csgInfo.glview->shaderinfo);
-// csgInfo.glview->setRenderFunc(thrownTogetherRenderer);
+ ThrownTogetherRenderer thrownTogetherRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain);
+// csgInfo.glview->setRenderer(&thrownTogetherRenderer);
csgInfo.glview->setRenderer(&opencsgRenderer);
csgInfo.glview->paintGL();
csgInfo.glview->save("out.png");
-// FIXME: Render & Grab buffer
-
- // QImage img = csgInfo.glview->grabFrameBuffer();
- // cout << "Image: " << img.width() << "x" << img.height() << " " << img.format() << "\n";
- // img.save("out.png");
-
destroy_builtin_functions();
destroy_builtin_modules();
contact: Jan Huwald // Impressum