summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2010-11-17 06:27:03 (GMT)
committerMarius Kintel <marius@kintel.net>2010-11-17 06:27:03 (GMT)
commitf1daaed76863dc3c43fa193cdca618a67690cf92 (patch)
tree84d3daa0dca235106c9877f77209dfc37c537dcb /src
parentb1c78d03df911ff5fad0b797b72ea7b88d09ca33 (diff)
Working state, still requires a show()
Diffstat (limited to 'src')
-rw-r--r--src/GLView.h3
-rw-r--r--src/glview.cc49
2 files changed, 32 insertions, 20 deletions
diff --git a/src/GLView.h b/src/GLView.h
index 7516894..f729838 100644
--- a/src/GLView.h
+++ b/src/GLView.h
@@ -18,6 +18,7 @@ class GLView : public QGLWidget
public:
GLView(QWidget *parent = NULL);
+ GLView(const QGLFormat & format, QWidget *parent = NULL);
void setRenderFunc(void (*func)(void*), void *userdata);
#ifdef ENABLE_OPENCSG
bool hasOpenCSGSupport() { return this->opencsg_support; }
@@ -45,6 +46,8 @@ public:
#endif
private:
+ void init();
+
void (*renderfunc)(void*);
void *renderfunc_vp;
diff --git a/src/glview.cc b/src/glview.cc
index e51f31f..f4b2ccf 100644
--- a/src/glview.cc
+++ b/src/glview.cc
@@ -39,35 +39,45 @@
GLView::GLView(QWidget *parent) : QGLWidget(parent)
{
- viewer_distance = 500;
- object_rot_x = 35;
- object_rot_y = 0;
- object_rot_z = 25;
- object_trans_x = 0;
- object_trans_y = 0;
- object_trans_z = 0;
+ init();
+}
- mouse_drag_active = false;
- last_mouse_x = 0;
- last_mouse_y = 0;
+GLView::GLView(const QGLFormat & format, QWidget *parent) : QGLWidget(format, parent)
+{
+ init();
+}
- orthomode = false;
- showaxes = false;
- showcrosshairs = false;
+void GLView::init()
+{
+ this->viewer_distance = 500;
+ this->object_rot_x = 35;
+ this->object_rot_y = 0;
+ this->object_rot_z = 25;
+ this->object_trans_x = 0;
+ this->object_trans_y = 0;
+ this->object_trans_z = 0;
+
+ this->mouse_drag_active = false;
+ this->last_mouse_x = 0;
+ this->last_mouse_y = 0;
- renderfunc = NULL;
- renderfunc_vp = NULL;
+ this->orthomode = false;
+ this->showaxes = false;
+ this->showcrosshairs = false;
+
+ this->renderfunc = NULL;
+ this->renderfunc_vp = NULL;
for (int i = 0; i < 10; i++)
- shaderinfo[i] = 0;
+ this->shaderinfo[i] = 0;
- statusLabel = NULL;
+ this->statusLabel = NULL;
setMouseTracking(true);
#ifdef ENABLE_OPENCSG
- opencsg_support = true;
+ this->opencsg_support = true;
static int sId = 0;
- opencsg_id = sId++;
+ this->opencsg_id = sId++;
#endif
}
@@ -513,4 +523,3 @@ void GLView::mouseReleaseEvent(QMouseEvent*)
mouse_drag_active = false;
releaseMouse();
}
-
contact: Jan Huwald // Impressum