summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/opengles31
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 /config.tests/unix/opengles31
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 'config.tests/unix/opengles31')
-rw-r--r--config.tests/unix/opengles31/opengles31.cpp50
-rw-r--r--config.tests/unix/opengles31/opengles31.pro13
2 files changed, 63 insertions, 0 deletions
diff --git a/config.tests/unix/opengles31/opengles31.cpp b/config.tests/unix/opengles31/opengles31.cpp
new file mode 100644
index 0000000000..c4f27a3be8
--- /dev/null
+++ b/config.tests/unix/opengles31/opengles31.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the config.tests of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <GLES3/gl31.h>
+
+int main(int, char **)
+{
+ glDispatchCompute(1, 1, 1);
+ glProgramUniform1i(0, 0, 0);
+
+ return 0;
+}
diff --git a/config.tests/unix/opengles31/opengles31.pro b/config.tests/unix/opengles31/opengles31.pro
new file mode 100644
index 0000000000..1df9cedfcd
--- /dev/null
+++ b/config.tests/unix/opengles31/opengles31.pro
@@ -0,0 +1,13 @@
+# The library is expected to be the same as in ES 2.0 (libGLESv2).
+# The difference is the header and the presence of the functions in
+# the library.
+
+SOURCES = opengles31.cpp
+INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
+
+for(p, QMAKE_LIBDIR_OPENGL_ES2) {
+ exists($$p):LIBS += -L$$p
+}
+
+CONFIG -= qt
+LIBS += $$QMAKE_LIBS_OPENGL_ES2