summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-02-24 03:33:28 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-02-24 03:33:28 (GMT)
commiteff16283358217b43b310269a72e0cb47357a8b3 (patch)
tree4852cb05e4a0bb380aa00dd91c6de5bd869a4ffd
parent958657eb268dcb3a68ade22cb67bb0db108e71ad (diff)
continue merging enable_opencsg_shaders
-rw-r--r--src/GLView.h12
-rw-r--r--src/OffscreenView.cc12
-rw-r--r--src/OffscreenView.h9
-rw-r--r--src/QGLView.h1
4 files changed, 27 insertions, 7 deletions
diff --git a/src/GLView.h b/src/GLView.h
index 2c5779d..39ec0a6 100644
--- a/src/GLView.h
+++ b/src/GLView.h
@@ -48,12 +48,12 @@ public:
size_t width;
size_t height;
- double viewer_distance;//
- double w_h_ratio;//
- bool orthomode;//
- bool showaxes;//
- bool showfaces;//
- bool showedges;//
+ double viewer_distance;
+ double w_h_ratio;
+ bool orthomode;
+ bool showaxes;
+ bool showfaces;
+ bool showedges;
Eigen::Vector3d object_trans;
Eigen::Vector3d object_rot;
Eigen::Vector3d camera_eye;
diff --git a/src/OffscreenView.cc b/src/OffscreenView.cc
index 1b53082..b7d1deb 100644
--- a/src/OffscreenView.cc
+++ b/src/OffscreenView.cc
@@ -7,6 +7,13 @@
#include <cstdlib>
#include <sstream>
+#ifdef _WIN32
+#include <GL/wglew.h>
+#elif !defined(__APPLE__)
+#include <GL/glxew.h>
+#endif
+
+
OffscreenView::OffscreenView(size_t width, size_t height)
{
orthomode = false;
@@ -18,6 +25,11 @@ OffscreenView::OffscreenView(size_t width, size_t height)
camera_center << 0, 0, 0;
#ifdef ENABLE_OPENCSG
+ is_opencsg_capable = false;
+ has_shaders = false;
+ opencsg_support = true;
+ static int sId = 0;
+ this->opencsg_id = sId++;
for (int i = 0; i < 10; i++) this->shaderinfo[i] = 0;
#endif
this->ctx = create_offscreen_context(width, height);
diff --git a/src/OffscreenView.h b/src/OffscreenView.h
index 3e03175..69bda4c 100644
--- a/src/OffscreenView.h
+++ b/src/OffscreenView.h
@@ -24,8 +24,15 @@ public:
bool save(const char *filename);
bool save(std::ostream &output);
std::string getRendererInfo() const;
- void enable_opencsg_shaders();
OffscreenContext *ctx; // not
+
+#ifdef ENABLE_OPENCSG
+ bool is_opencsg_capable;
+ bool has_shaders;
+ void enable_opencsg_shaders();
+ bool opencsg_support;
+ int opencsg_id;
+#endif
};
#endif
diff --git a/src/QGLView.h b/src/QGLView.h
index de53779..77c5baf 100644
--- a/src/QGLView.h
+++ b/src/QGLView.h
@@ -38,6 +38,7 @@ public:
void setOrthoMode(bool enabled) { this->orthomode = enabled; }
std::string getRendererInfo() const;
bool save(const char *filename);
+ void enable_opencsg_shaders();
public:
QLabel *statusLabel;
contact: Jan Huwald // Impressum