- and fixed compilation on linux systems too

Mon, 28 Jul 2014 16:38:34 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 28 Jul 2014 16:38:34 +0300
changeset 856
6bdc03091441
parent 855
e16f1587ef44
child 857
e62983881460

- and fixed compilation on linux systems too

src/glCompiler.h file | annotate | diff | comparison | revisions
src/glRenderer.cc file | annotate | diff | comparison | revisions
src/glRenderer.h file | annotate | diff | comparison | revisions
src/glShared.h file | annotate | diff | comparison | revisions
--- a/src/glCompiler.h	Mon Jul 28 03:34:05 2014 +0300
+++ b/src/glCompiler.h	Mon Jul 28 16:38:34 2014 +0300
@@ -24,11 +24,7 @@
 
 // =============================================================================
 //
-#ifdef USE_QT5
 class GLCompiler : protected QOpenGLFunctions
-#else
-class GLCompiler
-#endif
 {
 public:
 	struct ObjectVBOInfo
--- a/src/glRenderer.cc	Mon Jul 28 03:34:05 2014 +0300
+++ b/src/glRenderer.cc	Mon Jul 28 16:38:34 2014 +0300
@@ -237,7 +237,9 @@
 //
 void GLRenderer::initializeGL()
 {
+#ifdef USE_QT5
 	initializeOpenGLFunctions();
+#endif
 	setBackground();
 	glLineWidth (cfg::LineThickness);
 	glLineStipple (1, 0x6666);
@@ -1621,8 +1623,5 @@
 void GLRenderer::doMakeCurrent()
 {
 	makeCurrent();
-
-#ifdef USE_QT5
 	initializeOpenGLFunctions();
-#endif
 }
--- a/src/glRenderer.h	Mon Jul 28 03:34:05 2014 +0300
+++ b/src/glRenderer.h	Mon Jul 28 16:38:34 2014 +0300
@@ -135,11 +135,7 @@
 // and selection picking. The instance of GLRenderer is accessible as
 // g_win->R()
 //
-#ifdef USE_QT5
 class GLRenderer : public QGLWidget, protected QOpenGLFunctions
-#else
-class GLRenderer : public QGLWidget
-#endif
 {
 public:
 	Q_OBJECT
--- a/src/glShared.h	Mon Jul 28 03:34:05 2014 +0300
+++ b/src/glShared.h	Mon Jul 28 16:38:34 2014 +0300
@@ -17,7 +17,11 @@
  */
 
 #pragma once
-#include <QOpenGLFunctions>
+
+#ifdef USE_QT5
+# include <QOpenGLFunctions>
+#endif
+
 #include "basics.h"
 
 class LDObject;
@@ -62,6 +66,15 @@
 NUMERIC_ENUM_OPERATORS (EVBOSurface)
 NUMERIC_ENUM_OPERATORS (EVBOComplement)
 
+#ifndef USE_QT5
+// Placeholder QOpenGLFunctions for Qt 4.x support
+struct QOpenGLFunctions
+{
+	void initializeOpenGLFunctions() {}
+};
+
+#endif
+
 // KDevelop doesn't seem to understand some VBO stuff
 #ifdef IN_IDE_PARSER
 using GLint = int;

mercurial