summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mainwin.cc25
-rw-r--r--openscad.h6
2 files changed, 23 insertions, 8 deletions
diff --git a/mainwin.cc b/mainwin.cc
index 8291f6a..be51724 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -88,8 +88,10 @@ MainWindow::MainWindow(const char *filename)
menu->addSeparator();
- actViewModeLights = menu->addAction("Lights", this, SLOT(viewModeLights()));
- actViewModeLights->setCheckable(true);
+ actViewModeWireframe = menu->addAction("Wireframe", this, SLOT(viewModeWireframe()));
+ actViewModeWireframe->setCheckable(true);
+ actViewModeShaded = menu->addAction("Shaded", this, SLOT(viewModeShaded()));
+ actViewModeShaded->setCheckable(true);
menu->addSeparator();
menu->addAction("Top");
@@ -137,6 +139,7 @@ MainWindow::MainWindow(const char *filename)
#else
viewModeThrownTogether();
#endif
+ viewModeShaded();
setCentralWidget(s1);
current_win = NULL;
@@ -520,7 +523,7 @@ static void renderGLviaOpenCSG(void *vp)
if (m->root_chain) {
GLint *shaderinfo = m->screen->shaderinfo;
- if (m->screen->useLights)
+ if (m->screen->useLights || !shaderinfo[0])
shaderinfo = NULL;
std::vector<OpenCSG::Primitive*> primitives;
int j = 0;
@@ -601,6 +604,7 @@ static void renderGLviaCGAL(void *vp)
P.set_style(CGAL::OGL::SNC_BOUNDARY);
if (m->actViewModeCGALGrid->isChecked())
P.set_style(CGAL::OGL::SNC_SKELETON);
+ glDisable(GL_LIGHTING);
#if 0
P.draw();
#else
@@ -676,10 +680,19 @@ void MainWindow::viewModeThrownTogether()
screen->updateGL();
}
-void MainWindow::viewModeLights()
+void MainWindow::viewModeWireframe()
{
- screen->useLights = !screen->useLights;
+ screen->useLights = false;
+ actViewModeWireframe->setChecked(true);
+ actViewModeShaded->setChecked(false);
+ screen->updateGL();
+}
+
+void MainWindow::viewModeShaded()
+{
+ screen->useLights = true;
+ actViewModeWireframe->setChecked(false);
+ actViewModeShaded->setChecked(true);
screen->updateGL();
- actViewModeLights->setChecked(screen->useLights);
}
diff --git a/openscad.h b/openscad.h
index 0f8da36..c139d6e 100644
--- a/openscad.h
+++ b/openscad.h
@@ -507,7 +507,8 @@ public:
QAction *actViewModeCGALGrid;
#endif
QAction *actViewModeThrownTogether;
- QAction *actViewModeLights;
+ QAction *actViewModeWireframe;
+ QAction *actViewModeShaded;
void viewModeActionsUncheck();
private slots:
@@ -519,7 +520,8 @@ private slots:
void viewModeCGALGrid();
#endif
void viewModeThrownTogether();
- void viewModeLights();
+ void viewModeWireframe();
+ void viewModeShaded();
};
extern AbstractModule *parse(const char *text, int debug);
contact: Jan Huwald // Impressum