summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
commit9bd032355163d92cda5e7e59ecd21214b131f187 (patch)
tree002fa12558505683143c7eb08949a3d225bf0712 /src/opengl
parentd037d25c3d5236623371cf051aaf6a9e59792ba7 (diff)
parent41673c45dde2eb95ee21dd918235218399f2be2c (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.h25
-rw-r--r--src/opengl/qgl_p.h1
-rw-r--r--src/opengl/qglfunctions.h2
-rw-r--r--src/opengl/qglpaintdevice.cpp3
4 files changed, 15 insertions, 16 deletions
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index caa5b96cdc..031bdf3317 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -59,25 +59,26 @@ QT_BEGIN_HEADER
#endif
#if defined(Q_OS_MAC)
+# if !defined(QT_NO_CORESERVICES)
# include <OpenGL/gl.h>
+# else
+# if defined(QT_OPENGL_ES_2)
+# include <OpenGLES/ES2/gl.h>
+# endif
+# endif
#elif defined(QT_OPENGL_ES_2)
-# if defined(Q_OS_MAC)
-# include <OpenGLES/ES2/gl.h>
+# include <GLES2/gl2.h>
# else
-# include <GLES2/gl2.h>
+# include <GL/gl.h>
# endif
+
+#if defined(QT_OPENGL_ES_2)
# ifndef GL_DOUBLE
# define GL_DOUBLE GL_FLOAT
# endif
# ifndef GLdouble
typedef GLfloat GLdouble;
# endif
-#else
-# if defined(Q_OS_MAC)
-# include <OpenGL/gl.h>
-# else
-# include <GL/gl.h>
-# endif
#endif
QT_BEGIN_NAMESPACE
@@ -277,7 +278,6 @@ public:
QGLFormat requestedFormat() const;
void setFormat(const QGLFormat& format);
- // ### Qt 5: return bools + maybe remove virtuals
virtual void makeCurrent();
virtual void doneCurrent();
@@ -340,7 +340,7 @@ protected:
void setWindowCreated(bool on);
bool initialized() const;
void setInitialized(bool on);
- void generateFontDisplayLists(const QFont & fnt, int listBase); // ### Qt 5: remove
+ void generateFontDisplayLists(const QFont & fnt, int listBase);
uint colorIndex(const QColor& c) const;
void setValid(bool valid);
@@ -402,7 +402,6 @@ public:
bool isValid() const;
bool isSharing() const;
- // ### Qt 5: return bools
void makeCurrent();
void doneCurrent();
@@ -474,7 +473,7 @@ protected:
virtual void glInit();
virtual void glDraw();
- int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove
+ int fontDisplayListBase(const QFont & fnt, int listBase = 2000);
QGLWidget(QGLWidgetPrivate &dd,
const QGLFormat &format = QGLFormat(),
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 86645fd5c1..fb503a31f1 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -402,7 +402,6 @@ private slots:
}
};
-// ### make QGLContext a QObject in 5.0 and remove the proxy stuff
class Q_OPENGL_EXPORT QGLSignalProxy : public QObject
{
Q_OBJECT
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index da3ce7db4d..0cb0b712ba 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -43,9 +43,11 @@
#define QGLFUNCTIONS_H
#ifdef __GLEW_H__
+#if defined(Q_CC_GNU)
#warning qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined
#warning To use GLEW with Qt, do not include <QtOpenGL> or <QGLFunctions> after glew.h
#endif
+#endif
#include <QtOpenGL/qgl.h>
#include <QtGui/qopenglcontext.h>
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index 66a97a2ea5..dc77c0fbbb 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -76,8 +76,7 @@ void QGLPaintDevice::beginPaint()
{
// Make sure our context is the current one:
QGLContext *ctx = context();
- if (ctx != QGLContext::currentContext())
- ctx->makeCurrent();
+ ctx->makeCurrent();
// Record the currently bound FBO so we can restore it again
// in endPaint() and bind this device's FBO