LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0001-Do-not-include-glx.h-when-using-GLES.patch of Package opencv (Project openSUSE:Factory)

From 9be7aaacd55b6264f8b893277f3f44c1f2b37c47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=83=C2=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 15 Jul 2017 21:14:07 +0200
Subject: [PATCH] Do not include glx.h when using GLES

---
 modules/highgui/src/window_QT.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp
index 4cfce66..baea0a2 100644
--- a/modules/highgui/src/window_QT.cpp
+++ b/modules/highgui/src/window_QT.cpp
@@ -54,9 +54,12 @@
 #include <unistd.h>
 #endif
 
+// Get GL_PERSPECTIVE_CORRECTION_HINT definition, not available in GLES 2 or
+// OpenGL 3 core profile or later
 #ifdef HAVE_QT_OPENGL
-    #if defined Q_WS_X11 /* Qt4 */ || defined Q_OS_LINUX /* Qt5 */
-        #include <GL/glx.h>
+    #if defined Q_WS_X11 /* Qt4 */ || \
+        (!defined(QT_OPENGL_ES_2) && defined Q_OS_LINUX) /* Qt5 with desktop OpenGL */
+        #include <GL/gl.h>
     #endif
 #endif
 
-- 
2.13.2