summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-09 06:06:37 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-02-09 06:06:37 (GMT)
commit3b2824de581d6c50df4a2ffa53e46cd13385984b (patch)
tree72d6ed23b5685f37eb043ec6cf9338b0b0a911da /src
parent33b37f342415fae6b3a14147d189fafc6815e26b (diff)
Clifford Wolf:
Switched to OpenCSG-1.3.0 for MDI support (this version does not leak GL off screen buffers ;-) git-svn-id: http://svn.clifford.at/openscad/trunk@416 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src')
-rw-r--r--src/GLView.h9
-rw-r--r--src/glview.cc2
-rw-r--r--src/mainwin.cc6
3 files changed, 10 insertions, 7 deletions
diff --git a/src/GLView.h b/src/GLView.h
index dd896fc..7516894 100644
--- a/src/GLView.h
+++ b/src/GLView.h
@@ -39,6 +39,11 @@ public:
double object_trans_z;
GLint shaderinfo[11];
+#ifdef ENABLE_OPENCSG
+ bool opencsg_support;
+ int opencsg_id;
+#endif
+
private:
void (*renderfunc)(void*);
void *renderfunc_vp;
@@ -51,10 +56,6 @@ private:
double w_h_ratio;
-#ifdef ENABLE_OPENCSG
- bool opencsg_support;
-#endif
-
bool mouse_drag_active;
int last_mouse_x;
int last_mouse_y;
diff --git a/src/glview.cc b/src/glview.cc
index dc42a7f..29046e0 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -65,6 +65,8 @@ GLView::GLView(QWidget *parent) : QGLWidget(parent)
setMouseTracking(true);
#ifdef ENABLE_OPENCSG
opencsg_support = true;
+ static int sId = 0;
+ opencsg_id = sId++;
#endif
}
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 296c417..e9bbdaa 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1323,6 +1323,9 @@ static void renderGLviaOpenCSG(void *vp)
glew_initialized = 1;
glewInit();
}
+#ifdef ENABLE_MDI
+ OpenCSG::setContext(m->screen->opencsg_id);
+#endif
if (m->root_chain) {
GLint *shaderinfo = m->screen->shaderinfo;
if (!shaderinfo[0])
@@ -1335,9 +1338,6 @@ static void renderGLviaOpenCSG(void *vp)
renderCSGChainviaOpenCSG(m->highlights_chain, m->viewActionShowEdges->isChecked() ? shaderinfo : NULL, true, false);
}
}
-#ifdef ENABLE_MDI
- OpenCSG::reset();
-#endif
}
/*!
contact: Jan Huwald // Impressum