summaryrefslogtreecommitdiff
path: root/polyset.cc
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-15 01:00:41 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-15 01:00:41 (GMT)
commitf2bad69cf51c6e5b278bf38a2bd7eca2163aff9b (patch)
treedb30b829f246fd8e0e1b9a261c43d2eb531a7ccb /polyset.cc
parent812e8064aa99abd168e45a7b14ec533bb30823b6 (diff)
Started collecting GL colors in one place; added Preferences class which will become a preferences dialog, forked CGAL OGL_Helper to make colors configurable
git-svn-id: http://svn.clifford.at/openscad/trunk@301 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'polyset.cc')
-rw-r--r--polyset.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/polyset.cc b/polyset.cc
index 5bccd6a..ecaea4d 100644
--- a/polyset.cc
+++ b/polyset.cc
@@ -22,6 +22,7 @@
#include "openscad.h"
#include "printutils.h"
+#include "Preferences.h"
QCache<QString,PolySet::ps_cache_entry> PolySet::ps_cache(100);
@@ -133,16 +134,18 @@ void PolySet::render_surface(colormode_e colormode, csgmode_e csgmode, double *m
bool mirrored = m_scale_rotate_det < 0;
if (colormode == COLORMODE_MATERIAL) {
- glColor3ub(249, 215, 44);
+ const QColor &col = Preferences::inst()->color(Preferences::OPENCSG_FACE_FRONT_COLOR);
+ glColor3f(col.redF(), col.greenF(), col.blueF());
#ifdef ENABLE_OPENCSG
if (shaderinfo) {
- glUniform4f(shaderinfo[1], 249 / 255.0, 215 / 255.0, 44 / 255.0, 1.0);
+ glUniform4f(shaderinfo[1], col.redF(), col.greenF(), col.blueF(), 1.0f);
glUniform4f(shaderinfo[2], 255 / 255.0, 236 / 255.0, 94 / 255.0, 1.0);
}
#endif /* ENABLE_OPENCSG */
}
if (colormode == COLORMODE_CUTOUT) {
- glColor3ub(157, 203, 81);
+ const QColor &col = Preferences::inst()->color(Preferences::OPENCSG_FACE_BACK_COLOR);
+ glColor3f(col.redF(), col.greenF(), col.blueF());
#ifdef ENABLE_OPENCSG
if (shaderinfo) {
glUniform4f(shaderinfo[1], 157 / 255.0, 203 / 255.0, 81 / 255.0, 1.0);
contact: Jan Huwald // Impressum