From 17e6529f7ff18c6f47f1fcc35379addd78d7156e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
Date: Wed, 5 Jan 2011 12:14:38 +0100
Subject: Added warning if <QGLFunctions> is included when GLEW is present.

GLEW can not be used in combination with <QGLFunctions>.

Reviewed-by: Eskil Abrahamsen Blomfeldt
---
 dist/changes-4.8.0        | 2 ++
 src/opengl/qglfunctions.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/dist/changes-4.8.0 b/dist/changes-4.8.0
index c55faf6..fa50f24 100644
--- a/dist/changes-4.8.0
+++ b/dist/changes-4.8.0
@@ -51,6 +51,8 @@ QtGui
  - Removed dependency of OpenGL Utility Library (GLU)
  - Added QGLFunctions, which provides cross-platform access to the
    OpenGL/ES 2.0 API.
+ - Including <QtOpenGL> will not work in combination with GLEW, as
+   QGLFunctions will undefine GLEW's defines.
 
 
 ****************************************************************************
diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h
index e06de7f..88f43c0 100644
--- a/src/opengl/qglfunctions.h
+++ b/src/opengl/qglfunctions.h
@@ -42,6 +42,11 @@
 #ifndef QGLFUNCTIONS_H
 #define QGLFUNCTIONS_H
 
+#ifdef __GLEW_H__
+#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
+
 #include <QtOpenGL/qgl.h>
 
 QT_BEGIN_HEADER
-- 
cgit v0.12