File BMC_12929_meegographicssystem.patch of Package libmeegotouch
Description: remove the "kosher" way to define M_USE_OPENGL.
Check QT_CONFIG and define M_USE_OPENGL if OpenGL ES 2 support is available.
Author: Fathi Boudra <fathi.boudra@nokia.com>
--- a/src/corelib/painting/mgles2renderer.h
+++ b/src/corelib/painting/mgles2renderer.h
@@ -23,6 +23,7 @@
#include <QList>
#include <QSize>
#include <QString>
+#include <QtOpenGL>
#include "mexport.h"
class QGLContext;
@@ -34,16 +35,6 @@ class QPainter;
class QPixmap;
class QRect;
-//some definitions to enable building without gles2 libraries
-#ifdef QT_OPENGL_LIB
-# include <QtOpenGL>
-# ifdef QT_OPENGL_ES_2
-// TODO: It does not seem kosher to define a macro with global effect
-// in this place.
-# define M_USE_OPENGL
-# endif
-#endif
-
/*!
\class MGLES2Renderer
\brief A singleton class for rendering textured quads with custom shaders.
--- a/src/common_top.pri
+++ b/src/common_top.pri
@@ -125,6 +125,10 @@ contains(DEFINES, HAVE_MEEGOGRAPHICSSYST
QT += meegographicssystemhelper
}
+contains(QT_CONFIG, opengles2) {
+ DEFINES += M_USE_OPENGL
+}
+
!simulator: QT += opengl
QMAKE_EXTRA_TARGETS += check