summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-04-23 11:53:38 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-24 10:36:07 +0200
commita26e3ecc3ddb407b204df629f2d1561d2293e0ea (patch)
treecedddb9fdd05c5425241b06781963d2ef50b7370 /configure
parentbded052aad12514ba163ca8c7a73f241b3018a28 (diff)
Include GLES 3.0 and 3.1 headers when available
In ES builds configure will now check for OpenGL ES 3.0 and 3.1 availability. This allows qopengl.h to include the correct header and, by defining QT_OPENGL_ES_3 and QT_OPENGL_ES_3_1, the OpenGL wrappers can provide support for MapBuffer, VAOs, etc. on GLES 3.0+ too. Right now this is not possible since the only standard way to use an ES function specific to a given version is to use the function directly. The extension mechanism (eglGetProcAddress and friends), that is often used in desktop GL, is not available for such functions. [ChangeLog][QtGui] QtGui's OpenGL headers are now automatically including the highest available header (gl31.h, gl3.h or gl2.h) in OpenGL ES builds. Task-number: QTBUG-38168 Change-Id: Ib857c58fe1696a9546fdd1aa143a9237e80325a5 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 25 insertions, 10 deletions
diff --git a/configure b/configure
index 9786d2e5e6..dbb47ff1b7 100755
--- a/configure
+++ b/configure
@@ -2484,7 +2484,7 @@ Additional options:
-no-opengl .......... Do not support OpenGL.
-opengl <api> ....... Enable OpenGL support
With no parameter, this will attempt to auto-detect
- OpenGL ES 2, or regular desktop OpenGL.
+ OpenGL ES 2.0 and higher, or regular desktop OpenGL.
Use es2 for <api> to override auto-detection.
* -no-system-proxies .. Do not use system network proxies by default.
@@ -4675,7 +4675,7 @@ fi
# X11/MINGW OpenGL
if [ "$XPLATFORM_MINGW" = "yes" ]; then
- # auto-detect OpenGL support (es2 = OpenGL ES 2.x)
+ # auto-detect OpenGL support (es2 = OpenGL ES 2.0 or higher)
if [ "$CFG_GUI" = "no" ]; then
if [ "$CFG_OPENGL" = "auto" ]; then
CFG_OPENGL=no
@@ -4689,7 +4689,7 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
if compileTest x11/opengl "OpenGL"; then
CFG_OPENGL=desktop
- elif compileTest unix/opengles2 "OpenGL ES 2.x"; then
+ elif compileTest unix/opengles2 "OpenGL ES 2.0"; then
CFG_OPENGL=es2
else
if [ "$CFG_OPENGL" = "yes" ]; then
@@ -4715,8 +4715,8 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
;;
esac
elif [ "$CFG_OPENGL" = "es2" ]; then
- #OpenGL ES 2.x
- compileTest unix/opengles2 "OpenGL ES 2.x"
+ #OpenGL ES 2.0
+ compileTest unix/opengles2 "OpenGL ES 2.0"
if [ $? != "0" ]; then
echo "The OpenGL ES 2.0 functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
@@ -4758,11 +4758,11 @@ if [ "$XPLATFORM_MAC" = "yes" ]; then
fi
fi
-# auto-detect OpenGL support (es2 = OpenGL ES 2.x)
+# auto-detect OpenGL support (es2 = OpenGL ES 2.0 or higher)
if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
if compileTest unix/opengldesktop "OpenGL"; then
CFG_OPENGL=desktop
- elif compileTest unix/opengles2 "OpenGL ES 2.x"; then
+ elif compileTest unix/opengles2 "OpenGL ES 2.0"; then
CFG_OPENGL=es2
else
if [ "$CFG_OPENGL" = "yes" ]; then
@@ -4775,7 +4775,7 @@ if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
CFG_OPENGL=no
fi
elif [ "$CFG_OPENGL" = "es2" ]; then
- #OpenGL ES 2.x
+ #OpenGL ES 2.0
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists glesv2 2>/dev/null; then
QMAKE_INCDIR_OPENGL_ES2=`$PKG_CONFIG --cflags-only-I glesv2 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'`
QMAKE_LIBDIR_OPENGL_ES2=`$PKG_CONFIG --libs-only-L glesv2 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'`
@@ -4786,7 +4786,7 @@ elif [ "$CFG_OPENGL" = "es2" ]; then
QMakeVar set QMAKE_LIBS_OPENGL_ES2 "`shellArgumentListToQMakeList "$QMAKE_LIBS_OPENGL_ES2"`"
fi
- compileTest unix/opengles2 "OpenGL ES 2.x" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2
+ compileTest unix/opengles2 "OpenGL ES 2.0" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2
if [ $? != "0" ]; then
echo "The OpenGL ES 2.0 functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
@@ -4806,6 +4806,21 @@ elif [ "$CFG_OPENGL" = "desktop" ]; then
fi
fi
+# If OpenGL ES 2.0 is enabled, check for 3.0 and higher. This is used to allow
+# compile-time differentiation and including the version specific (but backwards
+# compatible) ES headers (for example, GLES3/gl31.h). Other than that, there is
+# no difference in the configuration, even the library is the same.
+if [ "$CFG_OPENGL" = "es2" ]; then
+ if compileTest unix/opengles3 "OpenGL ES 3.0" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2; then
+ # Add a define for ES3, in addition to ES and ES2.
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_3"
+ fi
+ if compileTest unix/opengles31 "OpenGL ES 3.1" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2; then
+ # Add a define for ES31.
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_3_1"
+ fi
+fi
+
# auto-detect FontConfig support
if [ "$CFG_FONTCONFIG" != "no" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then
@@ -6494,7 +6509,7 @@ report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading librarie
report_support " NIS ...................." "$CFG_NIS"
report_support " OpenGL / OpenVG:"
report_support " EGL .................." "$CFG_EGL"
-report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x"
+report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+"
report_support " OpenVG ..............." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
if [ -n "$PKG_CONFIG" ]; then