summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/corelib/qurl-generateTLDs/main.cpp34
-rw-r--r--util/glgen/README.txt151
-rw-r--r--util/glgen/codegenerator.cpp1099
-rw-r--r--util/glgen/codegenerator.h149
-rw-r--r--util/glgen/glgen.pro35
-rw-r--r--util/glgen/main.cpp61
-rw-r--r--util/glgen/qopenglextensions.cpp.footer792
-rw-r--r--util/glgen/qopenglextensions.cpp.header76
-rw-r--r--util/glgen/qopenglextensions.h.footer1520
-rw-r--r--util/glgen/qopenglextensions.h.header208
-rw-r--r--util/glgen/qopenglversionfunctions.cpp.footer8
-rw-r--r--util/glgen/qopenglversionfunctions.cpp.header220
-rw-r--r--util/glgen/qopenglversionfunctions.h.footer13
-rw-r--r--util/glgen/qopenglversionfunctions.h.header163
-rw-r--r--util/glgen/qopenglversionfunctions__VERSION__.cpp.footer2
-rw-r--r--util/glgen/qopenglversionfunctions__VERSION__.cpp.header55
-rw-r--r--util/glgen/qopenglversionfunctions__VERSION__.h.footer6
-rw-r--r--util/glgen/qopenglversionfunctions__VERSION__.h.header60
-rw-r--r--util/glgen/qopenglversionfunctionsfactory.cpp.footer2
-rw-r--r--util/glgen/qopenglversionfunctionsfactory.cpp.header52
-rw-r--r--util/glgen/qopenglversionfunctionsfactory_p.h.header73
-rw-r--r--util/glgen/specparser.cpp307
-rw-r--r--util/glgen/specparser.h209
-rw-r--r--util/lexgen/generator.cpp48
-rw-r--r--util/lexgen/generator.h36
-rw-r--r--util/lexgen/main.cpp4
-rw-r--r--util/lexgen/nfa.cpp4
-rw-r--r--util/lexgen/nfa.h4
-rw-r--r--util/lexgen/tests/tst_lexgen.cpp2
-rw-r--r--util/local_database/enumdata.py134
-rwxr-xr-xutil/local_database/qlocalexml2cpp.py3
-rw-r--r--util/unicode/main.cpp241
32 files changed, 5606 insertions, 165 deletions
diff --git a/util/corelib/qurl-generateTLDs/main.cpp b/util/corelib/qurl-generateTLDs/main.cpp
index 0d7a58dee1..1809ced808 100644
--- a/util/corelib/qurl-generateTLDs/main.cpp
+++ b/util/corelib/qurl-generateTLDs/main.cpp
@@ -121,12 +121,14 @@ int main(int argc, char **argv) {
outIndicesBuffer.write("static const quint16 tldCount = ");
outIndicesBuffer.write(QByteArray::number(lineCount));
outIndicesBuffer.write(";\n");
- outIndicesBuffer.write("static const quint16 tldIndices[");
+ outIndicesBuffer.write("static const quint32 tldIndices[");
// outIndicesBuffer.write(QByteArray::number(lineCount+1)); // not needed
outIndicesBuffer.write("] = {\n");
- int utf8Size = 0;
-// int charSize = 0;
+ int totalUtf8Size = 0;
+ int chunkSize = 0;
+ int stringUtf8Size = 0;
+ QStringList chunks;
for (int a = 0; a < lineCount; a++) {
bool lineIsEmpty = strings.at(a).isEmpty();
if (!lineIsEmpty) {
@@ -136,25 +138,41 @@ int main(int argc, char **argv) {
int zeroCount = strings.at(a).count(QLatin1String("\\0"));
int utf8CharsCount = strings.at(a).count(QLatin1String("\\x"));
int quoteCount = strings.at(a).count('"');
+ stringUtf8Size = strings.at(a).count() - (zeroCount + quoteCount + utf8CharsCount * 3);
+ chunkSize += stringUtf8Size;
+ if (chunkSize > 65535) {
+ static int chunkCount = 0;
+ qWarning() << "chunk" << ++chunkCount << "has length" << chunkSize - stringUtf8Size;
+ outDataBuffer.write(",\n\n");
+ chunks.append(QByteArray::number(totalUtf8Size));
+ chunkSize = 0;
+ }
outDataBuffer.write(strings.at(a).toUtf8());
if (!lineIsEmpty)
outDataBuffer.write("\n");
- outIndicesBuffer.write(QByteArray::number(utf8Size));
+ outIndicesBuffer.write(QByteArray::number(totalUtf8Size));
outIndicesBuffer.write(",\n");
- utf8Size += strings.at(a).count() - (zeroCount + quoteCount + utf8CharsCount * 3);
-// charSize += strings.at(a).count();
+ totalUtf8Size += stringUtf8Size;
}
- outIndicesBuffer.write(QByteArray::number(utf8Size));
+ chunks.append(QByteArray::number(totalUtf8Size));
+ outIndicesBuffer.write(QByteArray::number(totalUtf8Size));
outIndicesBuffer.write("};\n");
outIndicesBuffer.close();
outFile.write(outIndicesBufferBA);
outDataBuffer.close();
- outFile.write("\nstatic const char tldData[");
+ outFile.write("\nstatic const char *tldData[");
// outFile.write(QByteArray::number(charSize)); // not needed
outFile.write("] = {\n");
outFile.write(outDataBufferBA);
outFile.write("};\n");
+
+ // write chunk information
+ outFile.write("\nstatic const quint16 tldChunkCount = ");
+ outFile.write(QByteArray::number(chunks.count()));
+ outFile.write(";\nstatic const quint32 tldChunks[] = {");
+ outFile.write(chunks.join(", ").toLatin1());
+ outFile.write("};\n");
outFile.close();
printf("data generated to %s . Now copy the data from this file to src/corelib/io/qurltlds_p.h in your Qt repo\n", argv[2]);
exit(0);
diff --git a/util/glgen/README.txt b/util/glgen/README.txt
new file mode 100644
index 0000000000..ea2411f619
--- /dev/null
+++ b/util/glgen/README.txt
@@ -0,0 +1,151 @@
+Overview
+========
+
+This is the glgen application used to generate OpenGL related classes from the
+official Khronos OpenGL specification and typemap files.
+
+To run this application download the gl.spec and gl.tm files from:
+
+http://www.opengl.org/registry/api/gl.spec
+http://www.opengl.org/registry/api/gl.tm
+
+and place them into the application directory. These files are not stored in
+the Qt Project's git repo or downloaded automatically to
+
+a) avoid copyright issues
+b) make sure the version of OpenGL used is controlled by a human
+
+The glgen application parses these files and generates:
+
+1) A set of public classes, one for each combination of OpenGL version and profile.
+2) A set of backend helper classes that contain the actual function pointers
+3) A factory class for the classes in 1)
+4) A set of classes, one for each OpenGL extension which introduces new entry points
+
+We will now describe each of these categories.
+
+
+OpenGL Version and Profile Classes
+==================================
+
+The base class of this set is QAbstractOpenGLFunctions. From this we inherit one class
+for each OpenGL version and if supported, profile.
+
+The Core profile contains only the non-deprecated functionality. The Compatibility profile
+also includes all functionality that was removed in OpenGL 3.1. Therefore, for OpenGL
+3.2 onwards we have two classes for each version.
+
+All of these classes are named with the following convention:
+
+QOpenGLFunctions_<MAJOR>_<MINOR>[_PROFILE]
+
+For example QOpenGLFunctions_2_1, QOpenGLFunctions_4_3_Core
+
+The source and header files for these classes take the form
+
+qopenglfunction_<MAJOR>_<MINOR>[_PROFILE].cpp
+qopenglfunction_<MAJOR>_<MINOR>[_PROFILE].h
+
+and should be moved to
+
+$QTBASE/src/gui/opengl/
+
+and forms part of the public QtGui library API.
+
+
+Backend Helper Classes
+======================
+
+Every OpenGL function is categorised by which version it was introduced with and
+whether it is part of the Core Profile and is deemed part of the core specification
+or whther it is only part of the Compatibility profile and has been marked as
+deprecated.
+
+Glgen creates a backend helper class containing function pointers to match each
+possible case. E.g. QOpenGLFunctions_1_5_CoreBackend contains functions introduced
+in OpenGL 1.5 which are still core (not deprecated).
+
+The public frontend classes described above contain pointers to the set of backend
+objects necessary to implement the functions for their version and profile.
+
+Creating new instances of these backend objects for each public version functions
+object would be wasteful in terms of memory (repeated function pointers) and CPU
+time (no need to keep re-solving the same functions).
+
+We cannot share the backend objects globally as OpenGL entry point addresses are
+specific to the OpenGL context. They cannot even be reliably shared between a
+context group. This is not surprising if you consider the case of contexts in a share
+group where the contexts have different versions or even profiles. We therefore share
+the backend instances at the QOpenGLContext level using a simple reference counting
+scheme.
+
+When the frontend version functions objects are intialized they check to see if
+the associated context already has suitable backend objects available. If so they use
+them, otherwise they will create backend objects and associate them with the context.
+
+The backend classes are in
+
+qopenglversionfunctions.h
+qopenglversionfunctions.cpp
+
+and should also be moved to
+
+$QTBASE/src/gui/opengl/
+
+
+OpenGL Version and Profile Factory
+==================================
+
+Instances of the OpenGL version and profile classes described above can be obtained
+from QOpenGLContext by means of the versionFunctions() member. The OpenGLContext
+retains ownership of the QOpenGLFunctions_* object. If a suitable object does not
+already exist it is created by the factory class generated by glgen.
+
+It is possible to request version functions objects for any version/profile
+combination from a context. However not all requests can be serviced. For example
+consider the case of an OpenGL 3.3 Core profile context. In this case:
+
+* Requesting a 3.3 core profile functions object would succeed.
+* Requesting a 3.3 compatibility profile functions object would fail. We would fail
+ to resolve the deprecated functions.
+* Requesting a 4.3 core profile functions object would fail. We would fail to resolve
+ the new core functions introduced in versions 4.0-4.3.
+* Requesting a 3.1 functions object would succeed. There is nothing in 3.1 that is not
+ also in 3.3 core.
+
+If a request is not able to be serviced the factory, and hence QOpenGLContext::versionFunctions()
+will return a null pointer that can be checked for.
+
+The source and header file for this class should be moved to
+
+$QTBASE/src/gui/opengl/
+
+and forms part of the QtGui library.
+
+If a user instantiates a version functions object directly (i.e. not via QOpenGLContext)
+then it bypasses the above checks. However, the same checks are applied in the
+initializeOpenGLFunctions() method and the result can once again be checked.
+
+This approach allows maximum flexibility but ensure's safety in that once the user
+posesses a functions object that has been successfully initialized they can rely upon its
+member functions being successfully resolved.
+
+
+OpenGL Extension Classes
+========================
+
+In addition, glgen also creates one class for each OpenGL extension that introduces
+new entry points. These classes are named with the convention
+
+QOpenGLExtension_<name-of-extension>
+
+The usage pattern for OpenGL extensions is to just use a small
+number of extensions out of the large number of those available.
+
+Rather than bloat QtGui with all possible extensions, a new static library will be
+introduced to hold these classes. That way users will only link in the code for
+the extensions that they actually use.
+
+The source and header file for these classes should be moved to
+
+$QTBASE/src/openglextensions/ \ No newline at end of file
diff --git a/util/glgen/codegenerator.cpp b/util/glgen/codegenerator.cpp
new file mode 100644
index 0000000000..c6a77569dc
--- /dev/null
+++ b/util/glgen/codegenerator.cpp
@@ -0,0 +1,1099 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the utilities 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 "codegenerator.h"
+
+#include <QDebug>
+#include <QFile>
+#include <QSettings>
+#include <QTextStream>
+
+static const QString extensionRegistryFileName = QStringLiteral("qopengl-extension-registry.ini");
+static const QString extensionIdGroupName = QStringLiteral("ExtensionIds");
+
+CodeGenerator::CodeGenerator()
+ : m_parser(0)
+{
+}
+
+void CodeGenerator::generateCoreClasses(const QString &baseFileName) const
+{
+ // Output header and implementation files for the backend and base class
+ writeCoreHelperClasses(baseFileName + QStringLiteral(".h"), Declaration);
+ writeCoreHelperClasses(baseFileName + QStringLiteral(".cpp"), Definition);
+
+ // Output the per-version and profile public classes
+ writeCoreClasses(baseFileName);
+
+ // We also need to generate a factory class that can be used by
+ // QOpenGLContext to actually create version function objects
+ writeCoreFactoryHeader(baseFileName + QStringLiteral("factory_p.h"));
+ writeCoreFactoryImplementation(baseFileName + QStringLiteral("factory.cpp"));
+}
+
+void CodeGenerator::generateExtensionClasses(const QString &baseFileName) const
+{
+ writeExtensionHeader(baseFileName + QStringLiteral(".h"));
+ writeExtensionImplementation(baseFileName + QStringLiteral(".cpp"));
+}
+
+bool CodeGenerator::isLegacyVersion(Version v) const
+{
+ return (v.major < 3 || (v.major == 3 && v.minor == 0));
+}
+
+bool CodeGenerator::versionHasProfiles(Version v) const
+{
+ VersionProfile vp;
+ vp.version = v;
+ return vp.hasProfiles();
+}
+
+void CodeGenerator::writeCoreHelperClasses(const QString &fileName, ClassComponent component) const
+{
+ if (!m_parser)
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ writePreamble(fileName, stream);
+
+ // Iterate over each OpenGL version. For each version output a private class for
+ // core functions and a private class for deprecated functions.
+ const QString privateRootClass = QStringLiteral("QOpenGLVersionFunctionsBackend");
+ Q_FOREACH (const VersionProfile &versionProfile, m_parser->versionProfiles()) {
+ switch (component) {
+ case Declaration:
+ writeBackendClassDeclaration(stream, versionProfile, privateRootClass);
+ break;
+
+ case Definition:
+ writeBackendClassImplementation(stream, versionProfile, privateRootClass);
+ break;
+ }
+ }
+
+ // Write the postamble
+ writePostamble(fileName, stream);
+}
+
+void CodeGenerator::writeCoreClasses(const QString &baseFileName) const
+{
+ // Iterate over each OpenGL version. For each version output a public class (for legacy
+ // versions or two public classes (for modern versions with profiles). Each public class
+ // is given pointers to private classes containing the actual entry points. For example,
+ // the class for OpenGL 1.1 will have pointers to the private classes for 1.0 core, 1.1
+ // core, 1.0 deprecated and 1.1 deprecated. Whereas the class for OpenGL 3.2 Core profile
+ // will have pointers to the private classes for 1.0 core, 1.1 core, ..., 3.2 core but
+ // not to any of the deprecated private classes
+ QList<ClassComponent> components = (QList<ClassComponent>() << Declaration << Definition);
+ Q_FOREACH (const ClassComponent &component, components) {
+ const QString rootClass = QStringLiteral("QAbstractOpenGLFunctions");
+ Q_FOREACH (const Version &classVersion, m_parser->versions()) {
+ VersionProfile v;
+ v.version = classVersion;
+ v.profile = VersionProfile::CompatibilityProfile;
+
+ if (isLegacyVersion(classVersion)) {
+ switch (component) {
+ case Declaration:
+ writePublicClassDeclaration(baseFileName, v, rootClass);
+ break;
+
+ case Definition:
+ writePublicClassImplementation(baseFileName, v, rootClass);
+ break;
+ }
+ } else {
+ switch (component) {
+ case Declaration:
+ writePublicClassDeclaration(baseFileName, v, rootClass);
+ v.profile = VersionProfile::CoreProfile;
+ writePublicClassDeclaration(baseFileName, v, rootClass);
+ break;
+
+ case Definition:
+ writePublicClassImplementation(baseFileName, v, rootClass);
+ v.profile = VersionProfile::CoreProfile;
+ writePublicClassImplementation(baseFileName, v, rootClass);
+ break;
+ }
+ }
+ }
+ }
+}
+
+void CodeGenerator::writeCoreFactoryHeader(const QString &fileName) const
+{
+ if (!m_parser)
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ writePreamble(fileName, stream);
+
+ // Write the postamble
+ writePostamble(fileName, stream);
+}
+
+void CodeGenerator::writeCoreFactoryImplementation(const QString &fileName) const
+{
+ if (!m_parser)
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ writePreamble(fileName, stream);
+
+ // Get the set of version functions classes we need to create
+ QList<Version> versions = m_parser->versions();
+ qSort(versions.begin(), versions.end(), qGreater<Version>());
+
+ // Outout the #include statements
+ stream << QStringLiteral("#if !defined(QT_OPENGL_ES_2)") << endl;
+ Q_FOREACH (const Version &classVersion, versions) {
+ if (!versionHasProfiles(classVersion)) {
+ stream << QString(QStringLiteral("#include \"qopenglfunctions_%1_%2.h\""))
+ .arg(classVersion.major)
+ .arg(classVersion.minor) << endl;
+ } else {
+ const QList<VersionProfile::OpenGLProfile> profiles = (QList<VersionProfile::OpenGLProfile>()
+ << VersionProfile::CoreProfile << VersionProfile::CompatibilityProfile);
+
+ Q_FOREACH (const VersionProfile::OpenGLProfile profile, profiles) {
+ const QString profileSuffix = profile == VersionProfile::CoreProfile
+ ? QStringLiteral("core")
+ : QStringLiteral("compatibility");
+ stream << QString(QStringLiteral("#include \"qopenglfunctions_%1_%2_%3.h\""))
+ .arg(classVersion.major)
+ .arg(classVersion.minor)
+ .arg(profileSuffix) << endl;
+ }
+ }
+ }
+ stream << QStringLiteral("#else") << endl;
+ stream << QStringLiteral("#include \"qopenglfunctions_es2.h\"") << endl;
+ stream << QStringLiteral("#endif") << endl;
+
+ stream << endl;
+
+ stream << QStringLiteral("QT_BEGIN_NAMESPACE") << endl << endl;
+ stream << QStringLiteral("QAbstractOpenGLFunctions *QOpenGLVersionFunctionsFactory::create(const QOpenGLVersionProfile &versionProfile)") << endl;
+ stream << QStringLiteral("{") << endl;
+ stream << QStringLiteral("#if !defined(QT_OPENGL_ES_2)") << endl;
+ stream << QStringLiteral(" const int major = versionProfile.version().first;") << endl;
+ stream << QStringLiteral(" const int minor = versionProfile.version().second;") << endl << endl;
+
+ // Iterate over classes with profiles
+ stream << QStringLiteral(" if (versionProfile.hasProfiles()) {") << endl;
+ stream << QStringLiteral(" switch (versionProfile.profile()) {") << endl;
+ const QList<VersionProfile::OpenGLProfile> profiles = (QList<VersionProfile::OpenGLProfile>()
+ << VersionProfile::CoreProfile << VersionProfile::CompatibilityProfile);
+ Q_FOREACH (const VersionProfile::OpenGLProfile profile, profiles) {
+ const QString caseLabel = profile == VersionProfile::CoreProfile
+ ? QStringLiteral("QSurfaceFormat::CoreProfile")
+ : QStringLiteral("QSurfaceFormat::CompatibilityProfile");
+ stream << QString(QStringLiteral(" case %1:")).arg(caseLabel) << endl;
+
+ int i = 0;
+ Q_FOREACH (const Version &classVersion, versions) {
+ if (!versionHasProfiles(classVersion))
+ continue;
+
+ const QString ifString = (i++ == 0) ? QStringLiteral("if") : QStringLiteral("else if");
+ stream << QString(QStringLiteral(" %1 (major == %2 && minor == %3)"))
+ .arg(ifString)
+ .arg(classVersion.major)
+ .arg(classVersion.minor) << endl;
+
+ VersionProfile v;
+ v.version = classVersion;
+ v.profile = profile;
+ stream << QString(QStringLiteral(" return new %1;"))
+ .arg(generateClassName(v)) << endl;
+ }
+
+ stream << QStringLiteral(" break;") << endl << endl;
+ }
+
+ stream << QStringLiteral(" case QSurfaceFormat::NoProfile:") << endl;
+ stream << QStringLiteral(" default:") << endl;
+ stream << QStringLiteral(" break;") << endl;
+ stream << QStringLiteral(" };") << endl;
+ stream << QStringLiteral(" } else {") << endl;
+
+ // Iterate over the legacy classes (no profiles)
+ int i = 0;
+ Q_FOREACH (const Version &classVersion, versions) {
+ if (versionHasProfiles(classVersion))
+ continue;
+
+ const QString ifString = (i++ == 0) ? QStringLiteral("if") : QStringLiteral("else if");
+ stream << QString(QStringLiteral(" %1 (major == %2 && minor == %3)"))
+ .arg(ifString)
+ .arg(classVersion.major)
+ .arg(classVersion.minor) << endl;
+
+ VersionProfile v;
+ v.version = classVersion;
+ stream << QString(QStringLiteral(" return new %1;"))
+ .arg(generateClassName(v)) << endl;
+ }
+
+ stream << QStringLiteral(" }") << endl;
+ stream << QStringLiteral(" return 0;") << endl;
+
+ stream << QStringLiteral("#else") << endl;
+ stream << QStringLiteral(" Q_UNUSED(versionProfile);") << endl;
+ stream << QStringLiteral(" return new QOpenGLFunctions_ES2;") << endl;
+ stream << QStringLiteral("#endif") << endl;
+ stream << QStringLiteral("}") << endl;
+
+ // Write the postamble
+ writePostamble(fileName, stream);
+}
+
+/**
+ \returns all functions to be included in the class defined by \a classVersionProfile
+ */
+FunctionCollection CodeGenerator::functionCollection( const VersionProfile& classVersionProfile ) const
+{
+ const Version classVersion = classVersionProfile.version;
+ FunctionCollection functionSet;
+ QList<Version> versions = m_parser->versions();
+
+ // Populate these based upon the class version and profile
+ Version minVersion;
+ minVersion.major = 1;
+ minVersion.minor = 0;
+ Version maxVersion = classVersion;
+ QList<VersionProfile::OpenGLProfile> profiles;
+ profiles << VersionProfile::CoreProfile; // Always need core functions
+
+ if (isLegacyVersion(classVersion)
+ || (classVersionProfile.hasProfiles()
+ && classVersionProfile.profile == VersionProfile::CompatibilityProfile)) {
+ // For versions < 3.1 and Compatibility profile we include both core and deprecated functions
+ profiles << VersionProfile::CompatibilityProfile;
+ }
+
+ Q_FOREACH (const Version &v, versions) {
+ // Only include functions from versions in the range
+ if (v < minVersion)
+ continue;
+ if (v > maxVersion)
+ break;
+
+ Q_FOREACH (VersionProfile::OpenGLProfile profile, profiles) {
+ // Combine version and profile for this subset of functions
+ VersionProfile version;
+ version.version = v;
+ version.profile = profile;
+
+ // Fetch the functions and add to collection for this class
+ QList<Function> functions = m_parser->functionsForVersion(version);
+ functionSet.insert(version, functions);
+ }
+ }
+
+ return functionSet;
+}
+
+void CodeGenerator::writePreamble(const QString &baseFileName, QTextStream &stream, const QString replacement) const
+{
+ const QString fileName = baseFileName + QStringLiteral(".header");
+ if (!QFile::exists(fileName))
+ return;
+
+ QFile file(fileName);
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QTextStream preambleStream(&file);
+ QString preamble = preambleStream.readAll();
+ if (!replacement.isEmpty())
+ preamble.replace(QStringLiteral("__VERSION__"), replacement, Qt::CaseSensitive);
+ stream << preamble;
+ }
+}
+
+void CodeGenerator::writePostamble(const QString &baseFileName, QTextStream &stream) const
+{
+ const QString fileName = baseFileName + QStringLiteral(".footer");
+ if (!QFile::exists(fileName))
+ return;
+
+ QFile file(fileName);
+ if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QTextStream postambleStream(&file);
+ QString postamble = postambleStream.readAll();
+ stream << postamble;
+ }
+}
+
+QString CodeGenerator::passByType(const Argument &arg) const
+{
+ QString passBy;
+ switch (arg.mode) {
+ case Argument::Reference:
+ case Argument::Array:
+ passBy = QStringLiteral("*");
+ break;
+
+ default:
+ case Argument::Value:
+ passBy = QString();
+ }
+ return passBy;
+}
+
+QString CodeGenerator::safeArgumentName(const QString& arg) const
+{
+ if (arg == QStringLiteral("near")) // MS Windows defines near and far
+ return QStringLiteral("nearVal");
+ else if (arg == QStringLiteral("far"))
+ return QStringLiteral("farVal");
+ else if (arg == QStringLiteral("d"))
+ return QStringLiteral("dd"); // Don't shadow d pointer
+ else
+ return arg;
+}
+
+QString CodeGenerator::generateClassName(const VersionProfile &classVersion, ClassVisibility visibility) const
+{
+ QString className;
+ switch ( visibility ) {
+ case Public: {
+ // Class name and base class
+ QString profileSuffix;
+ if (classVersion.hasProfiles())
+ profileSuffix = (classVersion.profile == VersionProfile::CoreProfile ? QStringLiteral("_Core") : QStringLiteral("_Compatibility"));
+
+ className = QString(QStringLiteral("QOpenGLFunctions_%1_%2%3"))
+ .arg(classVersion.version.major)
+ .arg(classVersion.version.minor)
+ .arg(profileSuffix);
+ break;
+ }
+ case Private: {
+ QString statusSuffix = (classVersion.profile == VersionProfile::CoreProfile ? QStringLiteral("_Core") : QStringLiteral("_Deprecated"));
+
+ className = QString(QStringLiteral("QOpenGLFunctions_%1_%2%3Private"))
+ .arg(classVersion.version.major)
+ .arg(classVersion.version.minor)
+ .arg(statusSuffix);
+ break;
+ }
+ }
+
+ return className;
+}
+
+void CodeGenerator::writeBackendClassDeclaration(QTextStream &stream,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const
+{
+ const QString className = backendClassName(versionProfile);
+ stream << QString(QStringLiteral("class %1 : public %2"))
+ .arg(className)
+ .arg(baseClass)
+ << endl;
+ stream << QStringLiteral("{") << endl;
+ stream << QStringLiteral("public:") << endl;
+ stream << QString( QStringLiteral(" %1(QOpenGLContext *context);") ).arg(className) << endl << endl;
+
+ // Output function used for generating key used in QOpenGLContextPrivate
+ stream << QStringLiteral(" static QOpenGLVersionStatus versionStatus();") << endl << endl;
+
+ // Get the functions needed for this class
+ FunctionList functions = m_parser->functionsForVersion(versionProfile);
+ FunctionCollection functionSet;
+ functionSet.insert(versionProfile, functions);
+
+ // Declare the functions
+ writeClassFunctionDeclarations(stream, functionSet, Private);
+
+ stream << QStringLiteral("};") << endl;
+ stream << endl;
+}
+
+void CodeGenerator::writeBackendClassImplementation(QTextStream &stream,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const
+{
+ const QString className = backendClassName(versionProfile);
+ stream << QString(QStringLiteral("%1::%1(QOpenGLContext *context)")).arg(className) << endl;
+ stream << QString(QStringLiteral(" : %1(context)")).arg(baseClass) << endl
+ << QStringLiteral("{") << endl;
+
+ // Resolve the entry points for this set of functions
+ // Get the functions needed for this class
+ FunctionList functions = m_parser->functionsForVersion(versionProfile);
+ FunctionCollection functionSet;
+ functionSet.insert(versionProfile, functions);
+ writeEntryPointResolutionCode(stream, functionSet);
+
+ stream << QStringLiteral("}") << endl << endl;
+
+ stream << QString(QStringLiteral("QOpenGLVersionStatus %1::versionStatus()")).arg(className) << endl;
+ stream << QStringLiteral("{") << endl;
+ const QString status = versionProfile.profile == VersionProfile::CoreProfile
+ ? QStringLiteral("QOpenGLVersionStatus::CoreStatus")
+ : QStringLiteral("QOpenGLVersionStatus::DeprecatedStatus");
+ stream << QString(QStringLiteral(" return QOpenGLVersionStatus(%1, %2, %3);"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor)
+ .arg(status) << endl;
+ stream << QStringLiteral("}") << endl << endl;
+}
+
+QString CodeGenerator::coreClassFileName(const VersionProfile &versionProfile,
+ const QString& fileExtension) const
+{
+ QString profileSuffix;
+ if (versionProfile.hasProfiles())
+ profileSuffix = (versionProfile.profile == VersionProfile::CoreProfile ? QStringLiteral("_core") : QStringLiteral("_compatibility"));
+
+ const QString fileName = QString(QStringLiteral("qopenglfunctions_%1_%2%3.%4"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor)
+ .arg(profileSuffix)
+ .arg(fileExtension);
+ return fileName;
+}
+
+void CodeGenerator::writePublicClassDeclaration(const QString &baseFileName,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const
+{
+ const QString fileName = coreClassFileName(versionProfile, QStringLiteral("h"));
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ const QString templateFileName = QString(QStringLiteral("%1__VERSION__.h"))
+ .arg(baseFileName);
+ QString profileSuffix;
+ if (versionProfile.hasProfiles())
+ profileSuffix = (versionProfile.profile == VersionProfile::CoreProfile ? QStringLiteral("_CORE") : QStringLiteral("_COMPATIBILITY"));
+
+ const QString versionProfileString = QString(QStringLiteral("_%1_%2%3"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor)
+ .arg(profileSuffix);
+ writePreamble(templateFileName, stream, versionProfileString);
+
+ // Ctor, dtor, and initialize function;
+ const QString className = generateClassName(versionProfile, Public);
+ stream << QString(QStringLiteral("class Q_GUI_EXPORT %1 : public %2"))
+ .arg(className)
+ .arg(baseClass)
+ << endl;
+ stream << QStringLiteral("{") << endl;
+ stream << QStringLiteral("public:") << endl;
+ stream << QString(QStringLiteral(" %1();")).arg(className) << endl;
+ stream << QString(QStringLiteral(" ~%1();")).arg(className) << endl << endl;
+ stream << QStringLiteral(" bool initializeOpenGLFunctions() Q_DECL_OVERRIDE;") << endl << endl;
+
+ // Get the functions needed for this class and declare them
+ FunctionCollection functionSet = functionCollection(versionProfile);
+ writeClassFunctionDeclarations(stream, functionSet, Public);
+
+ // isCompatible function and backend variables
+ stream << QStringLiteral("private:") << endl;
+ stream << QStringLiteral(" friend class QOpenGLContext;") << endl << endl;
+ stream << QStringLiteral(" static bool isContextCompatible(QOpenGLContext *context);") << endl;
+ stream << QStringLiteral(" static QOpenGLVersionProfile versionProfile();") << endl << endl;
+ writeBackendVariableDeclarations(stream, backendsForFunctionCollection(functionSet));
+
+ stream << QStringLiteral("};") << endl << endl;
+
+ // Output the inline functions that forward OpenGL calls to the backends' entry points
+ writeClassInlineFunctions(stream, className, functionSet);
+
+ // Write the postamble
+ writePostamble(templateFileName, stream);
+}
+
+void CodeGenerator::writePublicClassImplementation(const QString &baseFileName,
+ const VersionProfile &versionProfile,
+ const QString& baseClass) const
+{
+ const QString fileName = coreClassFileName(versionProfile, QStringLiteral("cpp"));
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ const QString templateFileName = QString(QStringLiteral("%1__VERSION__.cpp"))
+ .arg(baseFileName);
+ QString profileSuffix;
+ if (versionProfile.hasProfiles())
+ profileSuffix = (versionProfile.profile == VersionProfile::CoreProfile ? QStringLiteral("_core") : QStringLiteral("_compatibility"));
+
+ const QString versionProfileString = QString(QStringLiteral("_%1_%2%3"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor)
+ .arg(profileSuffix);
+ writePreamble(templateFileName, stream, versionProfileString);
+
+ const QString className = generateClassName(versionProfile, Public);
+ stream << QStringLiteral("/*!") << endl
+ << QStringLiteral(" \\class ") << className << endl
+ << QStringLiteral(" \\inmodule QtGui") << endl
+ << QStringLiteral(" \\since 5.1") << endl
+ << QStringLiteral(" \\brief The ") << className
+ << QStringLiteral(" class provides all functions for this version and profile of OpenGL.") << endl << endl
+ << QStringLiteral(" \\sa QAbstractOpenGLFunctions") << endl
+ << QStringLiteral("*/") << endl << endl;
+
+ // Get the data we'll need for this class implementation
+ FunctionCollection functionSet = functionCollection(versionProfile);
+ QList<VersionProfile> backends = backendsForFunctionCollection(functionSet);
+
+ // Output default constructor
+ stream << className << QStringLiteral("::") << className << QStringLiteral("()") << endl;
+ stream << QStringLiteral(" : ") << baseClass << QStringLiteral("()");
+ Q_FOREACH (const VersionProfile &v, backends)
+ stream << endl << QString(QStringLiteral(" , %1(0)")).arg(backendVariableName(v));
+ stream << endl << QStringLiteral("{") << endl << QStringLiteral("}") << endl << endl;
+
+ // Output the destructor
+ stream << className << QStringLiteral("::~") << className << QStringLiteral("()") << endl;
+ stream << QStringLiteral("{") << endl;
+ Q_FOREACH (const VersionProfile &v, backends) {
+ const QString backendVar = backendVariableName(v);
+ const QString backendClass = backendClassName(v);
+ stream << QString(QStringLiteral(" if (%1 && !%1->refs.deref()) {")).arg(backendVar) << endl;
+ stream << QString(QStringLiteral(" QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(%1->context, %2::versionStatus());"))
+ .arg(backendVar)
+ .arg(backendClass) << endl;
+ stream << QString(QStringLiteral(" delete %1;")).arg(backendVar) << endl;
+ stream << QStringLiteral(" }") << endl;
+ }
+ stream << QStringLiteral("}") << endl << endl;
+
+ // Output the initialize function that creates the backend objects
+ stream << QString(QStringLiteral("bool %1::initializeOpenGLFunctions()")).arg(className) << endl;
+ stream << QStringLiteral("{") << endl;
+
+ stream << QStringLiteral(" if ( isInitialized() )") << endl;
+ stream << QStringLiteral(" return true;") << endl << endl;
+ stream << QStringLiteral(" QOpenGLContext* context = QOpenGLContext::currentContext();") << endl << endl;
+ stream << QStringLiteral(" // If owned by a context object make sure it is current.") << endl;
+ stream << QStringLiteral(" // Also check that current context is capable of resolving all needed functions") << endl;
+ stream << QStringLiteral(" if (((owningContext() && owningContext() == context) || !owningContext())") << endl;
+ stream << QString(QStringLiteral(" && %1::isContextCompatible(context))")).arg(className) << endl;
+ stream << QStringLiteral(" {") << endl;
+ stream << QStringLiteral(" // Associate with private implementation, creating if necessary") << endl;
+ stream << QStringLiteral(" // Function pointers in the backends are resolved at creation time") << endl;
+ stream << QStringLiteral(" QOpenGLVersionFunctionsBackend* d = 0;") << endl;
+
+ Q_FOREACH (const VersionProfile &v, backends) {
+ const QString backendClass = backendClassName(v);
+ const QString backendVar = backendVariableName(v);
+ stream << QString(QStringLiteral(" d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, %1::versionStatus());"))
+ .arg(backendClass) << endl;
+ stream << QStringLiteral(" if (!d) {") << endl;
+ stream << QString(QStringLiteral(" d = new %1(context);")).arg(backendClass) << endl;
+ stream << QString(QStringLiteral(" QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, %1::versionStatus(), d);"))
+ .arg(backendClass) << endl;
+ stream << QStringLiteral(" }") << endl;
+ stream << QString(QStringLiteral(" %1 = static_cast<%2*>(d);")).arg(backendVar).arg(backendClass) << endl;
+ stream << QStringLiteral(" d->refs.ref();") << endl << endl;
+ }
+
+ stream << QStringLiteral(" QAbstractOpenGLFunctions::initializeOpenGLFunctions();") << endl;
+ stream << QStringLiteral(" }") << endl;
+
+ stream << QStringLiteral(" return isInitialized();") << endl;
+ stream << QStringLiteral("}") << endl << endl;
+
+ // Output the context compatibility check function
+ stream << QString(QStringLiteral("bool %1::isContextCompatible(QOpenGLContext *context)")).arg(className) << endl;
+ stream << QStringLiteral("{") << endl;
+ stream << QStringLiteral(" Q_ASSERT(context);") << endl;
+ stream << QStringLiteral(" QSurfaceFormat f = context->format();") << endl;
+ stream << QStringLiteral(" const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());") << endl;
+ stream << QString(QStringLiteral(" if (v < qMakePair(%1, %2))"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor) << endl;
+ stream << QStringLiteral(" return false;") << endl << endl;
+
+ // If generating a legacy or compatibility profile class we need to ensure that
+ // the context does not expose only core functions
+ if (versionProfile.profile != VersionProfile::CoreProfile) {
+ stream << QStringLiteral(" if (f.profile() == QSurfaceFormat::CoreProfile)") << endl;
+ stream << QStringLiteral(" return false;") << endl << endl;
+ }
+
+ stream << QStringLiteral(" return true;") << endl;
+ stream << QStringLiteral("}") << endl << endl;
+
+ // Output static function used as helper in template versionFunctions() function
+ // in QOpenGLContext
+ stream << QString(QStringLiteral("QOpenGLVersionProfile %1::versionProfile()")).arg(className) << endl;
+ stream << QStringLiteral("{") << endl;
+ stream << QStringLiteral(" QOpenGLVersionProfile v;") << endl;
+ stream << QString(QStringLiteral(" v.setVersion(%1, %2);"))
+ .arg(versionProfile.version.major)
+ .arg(versionProfile.version.minor) << endl;
+ if (versionProfile.hasProfiles()) {
+ const QString profileName = versionProfile.profile == VersionProfile::CoreProfile
+ ? QStringLiteral("QSurfaceFormat::CoreProfile")
+ : QStringLiteral("QSurfaceFormat::CompatibilityProfile");
+ stream << QString(QStringLiteral(" v.setProfile(%1);")).arg(profileName) << endl;
+ }
+ stream << QStringLiteral(" return v;") << endl;
+ stream << QStringLiteral("}") << endl;
+
+ // Write the postamble
+ writePostamble(templateFileName, stream);
+}
+
+void CodeGenerator::writeClassFunctionDeclarations(QTextStream &stream,
+ const FunctionCollection &functionSet,
+ ClassVisibility visibility) const
+{
+ Q_FOREACH (const VersionProfile &version, functionSet.keys()) {
+ // Add a comment to the header
+ stream << QString(QStringLiteral(" // OpenGL %1.%2 %3 functions"))
+ .arg(version.version.major)
+ .arg(version.version.minor)
+ .arg((version.profile == VersionProfile::CoreProfile) ? QStringLiteral("core") : QStringLiteral("deprecated"))
+ << endl;
+
+ // Output function declarations
+ FunctionList functions = functionSet.value(version);
+ Q_FOREACH (const Function &f, functions)
+ writeFunctionDeclaration(stream, f, visibility);
+ stream << endl;
+ } // version and profile
+}
+
+void CodeGenerator::writeFunctionDeclaration(QTextStream &stream, const Function &f, ClassVisibility visibility) const
+{
+ QStringList argList;
+ Q_FOREACH (const Argument &arg, f.arguments) {
+ QString a = QString(QStringLiteral("%1%2 %3%4"))
+ .arg((arg.direction == Argument::In && arg.mode != Argument::Value) ? QStringLiteral("const ") : QString())
+ .arg(arg.type)
+ .arg(passByType(arg))
+ .arg(safeArgumentName(arg.name));
+ argList.append(a);
+ }
+ QString args = argList.join(QStringLiteral(", "));
+
+ QString signature;
+ switch (visibility) {
+ case Public:
+ signature = QString(QStringLiteral(" %1 gl%2(%3);")).arg(f.returnType).arg(f.name).arg(args);
+ break;
+
+ case Private:
+ default:
+ signature = QString(QStringLiteral(" %1 (QOPENGLF_APIENTRYP %2)(%3);")).arg(f.returnType).arg(f.name).arg(args);
+ }
+ stream << signature << endl;
+}
+
+void CodeGenerator::writeClassInlineFunctions(QTextStream &stream,
+ const QString &className,
+ const FunctionCollection &functionSet) const
+{
+ Q_FOREACH (const VersionProfile &version, functionSet.keys()) {
+
+ // Add a comment to the header
+ stream << QString(QStringLiteral("// OpenGL %1.%2 %3 functions"))
+ .arg(version.version.major)
+ .arg(version.version.minor)
+ .arg((version.profile == VersionProfile::CoreProfile) ? QStringLiteral("core") : QStringLiteral("deprecated"))
+ << endl;
+
+ // Output function declarations
+ const QString backendVar = backendVariableName(version);
+ FunctionList functions = functionSet.value(version);
+ Q_FOREACH (const Function &f, functions)
+ writeInlineFunction(stream, className, backendVar, f);
+
+ stream << endl;
+
+ } // version and profile
+}
+
+void CodeGenerator::writeInlineFunction(QTextStream &stream, const QString &className,
+ const QString &backendVar, const Function &f) const
+{
+ QStringList argList;
+ Q_FOREACH (const Argument &arg, f.arguments) {
+ QString a = QString(QStringLiteral("%1%2 %3%4"))
+ .arg((arg.direction == Argument::In && arg.mode != Argument::Value) ? QStringLiteral("const ") : QString())
+ .arg(arg.type)
+ .arg(passByType(arg))
+ .arg(safeArgumentName(arg.name));
+ argList.append(a);
+ }
+ QString args = argList.join(", ");
+
+
+ QString signature = QString(QStringLiteral("inline %1 %2::gl%3(%4)"))
+ .arg(f.returnType)
+ .arg(className)
+ .arg(f.name)
+ .arg(args);
+ stream << signature << endl << QStringLiteral("{") << endl;
+
+ QStringList argumentNames;
+ Q_FOREACH (const Argument &arg, f.arguments)
+ argumentNames.append(safeArgumentName(arg.name));
+ QString argNames = argumentNames.join(", ");
+
+ if (f.returnType == QStringLiteral("void"))
+ stream << QString(QStringLiteral(" %1->%2(%3);")).arg(backendVar).arg(f.name).arg(argNames) << endl;
+ else
+ stream << QString(QStringLiteral(" return %1->%2(%3);")).arg(backendVar).arg(f.name).arg(argNames) << endl;
+ stream << QStringLiteral("}") << endl << endl;
+}
+
+void CodeGenerator::writeEntryPointResolutionCode(QTextStream &stream,
+ const FunctionCollection &functionSet) const
+{
+ bool hasModuleHandle = false;
+ Q_FOREACH (const VersionProfile &version, functionSet.keys()) {
+
+ // Add a comment to the header
+ stream << QString(QStringLiteral(" // OpenGL %1.%2 %3 functions"))
+ .arg(version.version.major)
+ .arg(version.version.minor)
+ .arg((version.profile == VersionProfile::CoreProfile) ? QStringLiteral("core") : QStringLiteral("deprecated"))
+ << endl;
+
+ // Output function declarations
+ FunctionList functions = functionSet.value(version);
+
+ bool useGetProcAddress = (version.version.major == 1 && (version.version.minor == 0 || version.version.minor == 1));
+ if (useGetProcAddress) {
+ stream << "#if defined(Q_OS_WIN)" << endl;
+ if (!hasModuleHandle) {
+ stream << " HMODULE handle = GetModuleHandleA(\"opengl32.dll\");" << endl;
+ hasModuleHandle = true;
+ }
+
+ Q_FOREACH (const Function &f, functions)
+ writeEntryPointResolutionStatement(stream, f, QString(), useGetProcAddress);
+
+ stream << "#else" << endl;
+ }
+
+ Q_FOREACH (const Function &f, functions)
+ writeEntryPointResolutionStatement(stream, f);
+
+ if (useGetProcAddress)
+ stream << "#endif" << endl;
+
+ stream << endl;
+
+ } // version and profile
+}
+
+void CodeGenerator::writeEntryPointResolutionStatement(QTextStream &stream, const Function &f,
+ const QString &prefix, bool useGetProcAddress) const
+{
+ QStringList argList;
+ Q_FOREACH (const Argument &arg, f.arguments) {
+ QString a = QString("%1%2 %3")
+ .arg((arg.direction == Argument::In && arg.mode != Argument::Value) ? QStringLiteral("const ") : QString())
+ .arg(arg.type)
+ .arg(passByType(arg));
+ argList.append(a);
+ }
+ QString args = argList.join(QStringLiteral(", "));
+
+ QString signature;
+ if (!useGetProcAddress) {
+ signature = QString(QStringLiteral(" %4%3 = reinterpret_cast<%1 (QOPENGLF_APIENTRYP)(%2)>(context->getProcAddress(\"gl%3\"));"))
+ .arg(f.returnType)
+ .arg(args)
+ .arg(f.name)
+ .arg(prefix);
+ } else {
+ signature = QString(QStringLiteral(" %4%3 = reinterpret_cast<%1 (QOPENGLF_APIENTRYP)(%2)>(GetProcAddress(handle, \"gl%3\"));"))
+ .arg(f.returnType)
+ .arg(args)
+ .arg(f.name)
+ .arg(prefix);
+ }
+ stream << signature << endl;
+}
+
+QList<VersionProfile> CodeGenerator::backendsForFunctionCollection(const FunctionCollection &functionSet) const
+{
+ QList<VersionProfile> backends;
+ Q_FOREACH (const VersionProfile &versionProfile, functionSet.keys()) {
+ if (m_parser->versionProfiles().contains(versionProfile))
+ backends.append(versionProfile);
+ }
+ return backends;
+}
+
+QString CodeGenerator::backendClassName(const VersionProfile &v) const
+{
+ QString statusSuffix = v.profile == VersionProfile::CoreProfile
+ ? QStringLiteral("_Core")
+ : QStringLiteral("_Deprecated");
+ const QString className = QString(QStringLiteral("QOpenGLFunctions_%1_%2%3Backend"))
+ .arg(v.version.major)
+ .arg(v.version.minor)
+ .arg(statusSuffix);
+ return className;
+}
+
+QString CodeGenerator::backendVariableName(const VersionProfile &v) const
+{
+ const QString status = (v.profile == VersionProfile::CoreProfile)
+ ? QStringLiteral("Core")
+ : QStringLiteral("Deprecated");
+ const QString varName = QString(QStringLiteral("d_%1_%2_%3"))
+ .arg(v.version.major)
+ .arg(v.version.minor)
+ .arg(status);
+ return varName;
+}
+
+void CodeGenerator::writeBackendVariableDeclarations(QTextStream &stream, const QList<VersionProfile> &backends) const
+{
+ // We need a private class for each version and profile (status: core or deprecated)
+ Q_FOREACH (const VersionProfile &v, backends) {
+ const QString className = backendClassName(v);
+ const QString varName = backendVariableName(v);
+ stream << QString(QStringLiteral(" %1* %2;")).arg(className).arg(varName) << endl;
+ }
+}
+
+void CodeGenerator::writeExtensionHeader(const QString &fileName) const
+{
+ if (!m_parser)
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ writePreamble(fileName, stream);
+
+ // Iterate through the list of extensions and create one class per extension
+ QStringList extensions = m_parser->extensions();
+ Q_FOREACH (const QString &extension, extensions) {
+ writeExtensionClassDeclaration(stream, extension, Private);
+ writeExtensionClassDeclaration(stream, extension, Public);
+ }
+
+ // Write the postamble
+ writePostamble(fileName, stream);
+}
+
+void CodeGenerator::writeExtensionImplementation(const QString &fileName) const
+{
+ if (!m_parser)
+ return;
+
+ QFile file(fileName);
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return;
+ QTextStream stream(&file);
+
+ // Write the preamble
+ writePreamble(fileName, stream);
+
+ // Iterate through the list of extensions and create one class per extension
+ QStringList extensions = m_parser->extensions();
+ Q_FOREACH (const QString &extension, extensions)
+ writeExtensionClassImplementation(stream, extension);
+
+ // Write the postamble
+ writePostamble(fileName, stream);
+}
+
+void CodeGenerator::writeExtensionClassDeclaration(QTextStream &stream, const QString &extension, ClassVisibility visibility) const
+{
+ const QString className = generateExtensionClassName(extension, visibility);
+
+ QString baseClass = (visibility == Public) ? QStringLiteral("QAbstractOpenGLExtension") : QStringLiteral("QAbstractOpenGLExtensionPrivate");
+
+ stream << QString(QStringLiteral("class %2 : public %3"))
+ .arg(className)
+ .arg(baseClass)
+ << endl << "{" << endl << "public:" << endl;
+
+ if (visibility == Public) {
+ // Default constructor
+ stream << QStringLiteral(" ") << className << QStringLiteral("();") << endl << endl;
+
+ // Base class virtual function(s)
+ QString resolveFunction = QStringLiteral(" bool initializeOpenGLFunctions() Q_DECL_FINAL;");
+ stream << resolveFunction << endl << endl;
+ }
+
+ // Output the functions provided by this extension
+ QList<Function> functions = m_parser->functionsForExtension(extension);
+ Q_FOREACH (const Function &f, functions)
+ writeFunctionDeclaration(stream, f, visibility);
+
+ if (visibility == Public) {
+ // Write out the protected ctor
+ stream << endl << QStringLiteral("protected:") << endl;
+ stream << QStringLiteral(" Q_DECLARE_PRIVATE(") << className << QStringLiteral(")") << endl;
+ }
+
+ // End the class declaration
+ stream << QStringLiteral("};") << endl << endl;
+
+ // Output the inline functions for public class
+ if (visibility == Public) {
+ Q_FOREACH (const Function &f, functions)
+ writeExtensionInlineFunction(stream, className, f);
+ }
+}
+
+void CodeGenerator::writeExtensionInlineFunction(QTextStream &stream, const QString &className, const Function &f) const
+{
+ QStringList argList;
+ Q_FOREACH (const Argument &arg, f.arguments) {
+ QString a = QString(QStringLiteral("%1%2 %3%4"))
+ .arg((arg.direction == Argument::In && arg.mode != Argument::Value) ? QStringLiteral("const ") : QString())
+ .arg(arg.type)
+ .arg(passByType(arg))
+ .arg(safeArgumentName(arg.name));
+ argList.append(a);
+ }
+ QString args = argList.join(", ");
+
+
+ QString signature = QString(QStringLiteral("inline %1 %2::gl%3(%4)"))
+ .arg(f.returnType)
+ .arg(className)
+ .arg(f.name)
+ .arg(args);
+ stream << signature << endl << QStringLiteral("{") << endl;
+
+ stream << QString(QStringLiteral(" Q_D(%1);")).arg(className) << endl;
+
+ QStringList argumentNames;
+ Q_FOREACH (const Argument &arg, f.arguments)
+ argumentNames.append(safeArgumentName(arg.name));
+ QString argNames = argumentNames.join(", ");
+
+ if (f.returnType == QStringLiteral("void"))
+ stream << QString(QStringLiteral(" d->%1(%2);")).arg(f.name).arg(argNames) << endl;
+ else
+ stream << QString(QStringLiteral(" return d->%1(%2);")).arg(f.name).arg(argNames) << endl;
+ stream << QStringLiteral("}") << endl << endl;
+}
+
+void CodeGenerator::writeExtensionClassImplementation(QTextStream &stream, const QString &extension) const
+{
+ const QString className = generateExtensionClassName(extension);
+ const QString privateClassName = generateExtensionClassName(extension, Private);
+
+ // Output default constructor
+ stream << className << QStringLiteral("::") << className << QStringLiteral("()") << endl;
+ stream << QStringLiteral(" : QAbstractOpenGLExtension(*(new ") << privateClassName << QStringLiteral("))") << endl;
+ stream << QStringLiteral("{") << endl << QStringLiteral("}") << endl << endl;
+
+
+ // Output function to initialize this class
+ stream << QStringLiteral("bool ") << className
+ << QStringLiteral("::initializeOpenGLFunctions()") << endl
+ << QStringLiteral("{") << endl;
+
+ stream << QStringLiteral(" if (isInitialized())") << endl;
+ stream << QStringLiteral(" return true;") << endl << endl;
+
+ stream << QStringLiteral(" QOpenGLContext *context = QOpenGLContext::currentContext();") << endl;
+ stream << QStringLiteral(" if (!context) {") << endl;
+ stream << QStringLiteral(" qWarning(\"A current OpenGL context is required to resolve OpenGL extension functions\");")
+ << endl;
+ stream << QStringLiteral(" return false;") << endl;
+ stream << QStringLiteral(" }") << endl << endl;
+
+ // Output code to resolve entry points for this class
+ stream << QStringLiteral(" // Resolve the functions") << endl;
+ stream << QStringLiteral(" Q_D(") << className << QStringLiteral(");") << endl;
+ stream << endl;
+
+ // Output function declarations
+ QList<Function> functions = m_parser->functionsForExtension(extension);
+ Q_FOREACH (const Function &f, functions)
+ writeEntryPointResolutionStatement(stream, f, QStringLiteral("d->"));
+
+ // Call the base class implementation
+ stream << QStringLiteral(" QAbstractOpenGLExtension::initializeOpenGLFunctions();") << endl;
+
+ // Finish off
+ stream << QStringLiteral(" return true;") << endl;
+ stream << QStringLiteral("}") << endl << endl;
+}
+
+QString CodeGenerator::generateExtensionClassName(const QString &extension, ClassVisibility visibility) const
+{
+ QString visibilitySuffix;
+ if (visibility == Private)
+ visibilitySuffix = QStringLiteral("Private");
+
+ return QString(QStringLiteral("QOpenGLExtension_%1%2"))
+ .arg(extension)
+ .arg(visibilitySuffix);
+}
diff --git a/util/glgen/codegenerator.h b/util/glgen/codegenerator.h
new file mode 100644
index 0000000000..7ad4d49e8d
--- /dev/null
+++ b/util/glgen/codegenerator.h
@@ -0,0 +1,149 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the utilities 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$
+**
+****************************************************************************/
+
+#ifndef CODEGENERATOR_H
+#define CODEGENERATOR_H
+
+#include "specparser.h"
+
+class QTextStream;
+
+class CodeGenerator
+{
+public:
+ explicit CodeGenerator();
+
+ void setParser(SpecParser *parser) {m_parser = parser;}
+
+ void generateCoreClasses(const QString &baseFileName) const;
+
+ void generateExtensionClasses(const QString &baseFileName) const;
+
+private:
+ // Generic support
+ enum ClassVisibility {
+ Public,
+ Private
+ };
+
+ enum ClassComponent {
+ Declaration = 0,
+ Definition
+ };
+
+ bool isLegacyVersion(Version v) const;
+ bool versionHasProfiles(Version v) const;
+
+ FunctionCollection functionCollection( const VersionProfile& classVersionProfile ) const;
+
+ void writePreamble(const QString &baseFileName, QTextStream &stream, const QString replacement = QString()) const;
+ void writePostamble(const QString &baseFileName, QTextStream &stream) const;
+
+ QString passByType(const Argument &arg) const;
+ QString safeArgumentName(const QString& arg) const;
+
+ // Core functionality support
+ QString coreClassFileName(const VersionProfile &versionProfile,
+ const QString& fileExtension) const;
+ void writeCoreHelperClasses(const QString &fileName, ClassComponent component) const;
+ void writeCoreClasses(const QString &baseFileName) const;
+
+ void writeCoreFactoryHeader(const QString &fileName) const;
+ void writeCoreFactoryImplementation(const QString &fileName) const;
+
+ QString generateClassName(const VersionProfile &classVersion, ClassVisibility visibility = Public) const;
+
+ void writeBackendClassDeclaration(QTextStream &stream,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const;
+ void writeBackendClassImplementation(QTextStream &stream,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const;
+
+ void writePublicClassDeclaration(const QString &baseFileName,
+ const VersionProfile &versionProfile,
+ const QString &baseClass) const;
+ void writePublicClassImplementation(const QString &baseFileName,
+ const VersionProfile &versionProfile,
+ const QString& baseClass) const;
+
+ void writeClassFunctionDeclarations(QTextStream &stream,
+ const FunctionCollection &functionSets,
+ ClassVisibility visibility) const;
+
+ void writeFunctionDeclaration(QTextStream &stream, const Function &f, ClassVisibility visibility) const;
+
+ void writeClassInlineFunctions(QTextStream &stream,
+ const QString &className,
+ const FunctionCollection &functionSet) const;
+
+ void writeInlineFunction(QTextStream &stream, const QString &className,
+ const QString &backendVar, const Function &f) const;
+
+ void writeEntryPointResolutionCode(QTextStream &stream,
+ const FunctionCollection &functionSet) const;
+
+ void writeEntryPointResolutionStatement(QTextStream &stream, const Function &f,
+ const QString &prefix = QString(), bool useGetProcAddress = false) const;
+
+ QList<VersionProfile> backendsForFunctionCollection(const FunctionCollection &functionSet) const;
+ QString backendClassName(const VersionProfile &v) const;
+ QString backendVariableName(const VersionProfile &v) const;
+ void writeBackendVariableDeclarations(QTextStream &stream, const QList<VersionProfile> &backends) const;
+
+
+ // Extension class support
+ void writeExtensionHeader(const QString &fileName) const;
+ void writeExtensionImplementation(const QString &fileName) const;
+
+ void writeExtensionClassDeclaration(QTextStream &stream,
+ const QString &extension,
+ ClassVisibility visibility = Public) const;
+ void writeExtensionClassImplementation(QTextStream &stream, const QString &extension) const;
+
+ QString generateExtensionClassName(const QString &extension, ClassVisibility visibility = Public) const;
+ void writeExtensionInlineFunction(QTextStream &stream, const QString &className, const Function &f) const;
+
+ SpecParser *m_parser;
+ mutable QMap<QString, int> m_extensionIds;
+};
+
+#endif // CODEGENERATOR_H
diff --git a/util/glgen/glgen.pro b/util/glgen/glgen.pro
new file mode 100644
index 0000000000..9208ba9e8e
--- /dev/null
+++ b/util/glgen/glgen.pro
@@ -0,0 +1,35 @@
+QT -= gui
+CONFIG += console
+CONFIG -= app_bundle
+
+# Uncomment following to enable debug output
+#DEFINES += SPECPARSER_DEBUG
+
+TEMPLATE = app
+TARGET = glgen
+
+SOURCES += main.cpp \
+ specparser.cpp \
+ codegenerator.cpp
+
+HEADERS += \
+ specparser.h \
+ codegenerator.h
+
+OTHER_FILES += \
+ qopenglversionfunctions.h.header \
+ qopenglversionfunctions.h.footer \
+ qopenglversionfunctions.cpp.header \
+ qopenglversionfunctions.cpp.footer \
+ qopenglversionfunctions__VERSION__.cpp.footer \
+ qopenglversionfunctions__VERSION__.cpp.header \
+ qopenglversionfunctions__VERSION__.h.footer \
+ qopenglversionfunctions__VERSION__.h.header \
+ qopenglversionfunctionsfactory_p.h.header \
+ qopenglextensions.cpp.header \
+ qopenglextensions.cpp.footer \
+ qopenglextensions.h.header \
+ qopenglextensions.h.footer \
+ qopenglversionfunctionsfactory.cpp.header \
+ qopenglversionfunctionsfactory.cpp.footer \
+ README.txt
diff --git a/util/glgen/main.cpp b/util/glgen/main.cpp
new file mode 100644
index 0000000000..15c311caf3
--- /dev/null
+++ b/util/glgen/main.cpp
@@ -0,0 +1,61 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the utilities 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 "codegenerator.h"
+#include "specparser.h"
+
+int main(int argc, char *argv[])
+{
+ Q_UNUSED(argc);
+ Q_UNUSED(argv);
+
+ SpecParser parser;
+ parser.setTypeMapFileName(QStringLiteral("gl.tm"));
+ parser.setSpecFileName(QStringLiteral("gl.spec"));
+ parser.parse();
+
+ CodeGenerator generator;
+ generator.setParser(&parser);
+ generator.generateCoreClasses(QStringLiteral("qopenglversionfunctions"));
+ generator.generateExtensionClasses(QStringLiteral("qopenglextensions"));
+
+ return 0;
+}
diff --git a/util/glgen/qopenglextensions.cpp.footer b/util/glgen/qopenglextensions.cpp.footer
new file mode 100644
index 0000000000..d7bd157743
--- /dev/null
+++ b/util/glgen/qopenglextensions.cpp.footer
@@ -0,0 +1,792 @@
+
+#else
+
+QOpenGLExtension_OES_EGL_image::QOpenGLExtension_OES_EGL_image()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_OES_EGL_imagePrivate))
+{
+}
+
+bool QOpenGLExtension_OES_EGL_image::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_OES_EGL_image);
+
+ d->EGLImageTargetTexture2DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLeglImageOES image))context->getProcAddress("glEGLImageTargetTexture2DOES");
+ d->EGLImageTargetRenderbufferStorageOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLeglImageOES image))context->getProcAddress("glEGLImageTargetRenderbufferStorageOESs");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_OES_get_program_binary::QOpenGLExtension_OES_get_program_binary()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_OES_get_program_binaryPrivate))
+{
+}
+
+bool QOpenGLExtension_OES_get_program_binary::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_OES_get_program_binary);
+
+ d->GetProgramBinaryOES = (void (QOPENGLF_APIENTRYP)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary))context->getProcAddress("glGetProgramBinaryOES");
+ d->ProgramBinaryOES = (void (QOPENGLF_APIENTRYP)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length))context->getProcAddress("glProgramBinaryOES");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_OES_mapbuffer::QOpenGLExtension_OES_mapbuffer()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_OES_mapbufferPrivate))
+{
+}
+
+bool QOpenGLExtension_OES_mapbuffer::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_OES_mapbuffer);
+
+ d->MapBufferOES = (void* (QOPENGLF_APIENTRYP)(GLenum target, GLenum access))context->getProcAddress("glMapBufferOES");
+ d->UnmapBufferOES = (GLboolean (QOPENGLF_APIENTRYP)(GLenum target))context->getProcAddress("glUnmapBufferOES");
+ d->GetBufferPointervOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLenum pname, GLvoid** params))context->getProcAddress("glGetBufferPointervOES");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_OES_texture_3D::QOpenGLExtension_OES_texture_3D()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_OES_texture_3DPrivate))
+{
+}
+
+bool QOpenGLExtension_OES_texture_3D::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_OES_texture_3D);
+
+ d->TexImage3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels))context->getProcAddress("glTexImage3DOES");
+ d->TexSubImage3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels))context->getProcAddress("glTexSubImage3DOES");
+ d->CopyTexSubImage3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height))context->getProcAddress("glCopyTexSubImage3DOES");
+ d->CompressedTexImage3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data))context->getProcAddress("glCompressedTexImage3DOES");
+ d->CompressedTexSubImage3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data))context->getProcAddress("glCompressedTexSubImage3DOES");
+ d->FramebufferTexture3DOES = (void (QOPENGLF_APIENTRYP)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset))context->getProcAddress("glFramebufferTexture3DOES");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_OES_vertex_array_object::QOpenGLExtension_OES_vertex_array_object()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_OES_vertex_array_objectPrivate))
+{
+}
+
+bool QOpenGLExtension_OES_vertex_array_object::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_OES_vertex_array_object);
+
+ d->BindVertexArrayOES = (void (QOPENGLF_APIENTRYP)(GLuint array))context->getProcAddress("glBindVertexArrayOES");
+ d->DeleteVertexArraysOES = (void (QOPENGLF_APIENTRYP)(GLsizei n, const GLuint *arrays))context->getProcAddress("glDeleteVertexArraysOES");
+ d->GenVertexArraysOES = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *arrays))context->getProcAddress("glGenVertexArraysOES");
+ d->IsVertexArrayOES = (GLboolean (QOPENGLF_APIENTRYP)(GLuint array))context->getProcAddress("glIsVertexArrayOES");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_AMD_performance_monitor::QOpenGLExtension_AMD_performance_monitor()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_AMD_performance_monitorPrivate))
+{
+}
+
+bool QOpenGLExtension_AMD_performance_monitor::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+
+ d->GetPerfMonitorGroupsAMD = (void (QOPENGLF_APIENTRYP)(GLint *numGroups, GLsizei groupsSize, GLuint *groups))context->getProcAddress("glGetPerfMonitorGroupsAMD");
+ d->GetPerfMonitorCountersAMD = (void (QOPENGLF_APIENTRYP)(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters))context->getProcAddress("glGetPerfMonitorCountersAMD");
+ d->GetPerfMonitorGroupStringAMD = (void (QOPENGLF_APIENTRYP)(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString))context->getProcAddress("glGetPerfMonitorGroupStringAMD");
+ d->GetPerfMonitorCounterStringAMD = (void (QOPENGLF_APIENTRYP)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString))context->getProcAddress("glGetPerfMonitorCounterStringAMD");
+ d->GetPerfMonitorCounterInfoAMD = (void (QOPENGLF_APIENTRYP)(GLuint group, GLuint counter, GLenum pname, GLvoid *data))context->getProcAddress("glGetPerfMonitorCounterInfoAMD");
+ d->GenPerfMonitorsAMD = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *monitors))context->getProcAddress("glGenPerfMonitorsAMD");
+ d->DeletePerfMonitorsAMD = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *monitors))context->getProcAddress("glDeletePerfMonitorsAMD");
+ d->SelectPerfMonitorCountersAMD = (void (QOPENGLF_APIENTRYP)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList))context->getProcAddress("glSelectPerfMonitorCountersAMD");
+ d->BeginPerfMonitorAMD = (void (QOPENGLF_APIENTRYP)(GLuint monitor))context->getProcAddress("glBeginPerfMonitorAMD");
+ d->EndPerfMonitorAMD = (void (QOPENGLF_APIENTRYP )(GLuint monitor))context->getProcAddress("glEndPerfMonitorAMD");
+ d->GetPerfMonitorCounterDataAMD = (void (QOPENGLF_APIENTRYP)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten))context->getProcAddress("glGetPerfMonitorCounterDataAMD");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_ANGLE_framebuffer_blit::QOpenGLExtension_ANGLE_framebuffer_blit()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_ANGLE_framebuffer_blitPrivate))
+{
+}
+
+bool QOpenGLExtension_ANGLE_framebuffer_blit::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_ANGLE_framebuffer_blit);
+
+ d->BlitFramebufferANGLE = (void (QOPENGLF_APIENTRYP)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter))context->getProcAddress("glBlitFramebufferANGLE");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_ANGLE_framebuffer_multisample::QOpenGLExtension_ANGLE_framebuffer_multisample()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_ANGLE_framebuffer_multisamplePrivate))
+{
+}
+
+bool QOpenGLExtension_ANGLE_framebuffer_multisample::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_ANGLE_framebuffer_multisample);
+
+ d->RenderbufferStorageMultisampleANGLE = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height))context->getProcAddress("glRenderbufferStorageMultisampleANGLE");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_ANGLE_instanced_arrays::QOpenGLExtension_ANGLE_instanced_arrays()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_ANGLE_instanced_arraysPrivate))
+{
+}
+
+bool QOpenGLExtension_ANGLE_instanced_arrays::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_ANGLE_instanced_arrays);
+
+ d->DrawArraysInstancedANGLE = (void (QOPENGLF_APIENTRYP)(GLenum mode, GLint first, GLsizei count, GLsizei primcount))context->getProcAddress("glDrawArraysInstancedANGLE");
+ d->DrawElementsInstancedANGLE = (void (QOPENGLF_APIENTRYP)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount))context->getProcAddress("glDrawElementsInstancedANGLE");
+ d->VertexAttribDivisorANGLE = (void (QOPENGLF_APIENTRYP)(GLuint index, GLuint divisor))context->getProcAddress("glVertexAttribDivisorANGLE");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_ANGLE_translated_shader_source::QOpenGLExtension_ANGLE_translated_shader_source()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_ANGLE_translated_shader_sourcePrivate))
+{
+}
+
+bool QOpenGLExtension_ANGLE_translated_shader_source::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_ANGLE_translated_shader_source);
+
+ d->GetTranslatedShaderSourceANGLE = (void (QOPENGLF_APIENTRYP)(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source))context->getProcAddress("glGetTranslatedShaderSourceANGLE");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_APPLE_framebuffer_multisample::QOpenGLExtension_APPLE_framebuffer_multisample()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_APPLE_framebuffer_multisamplePrivate))
+{
+}
+
+bool QOpenGLExtension_APPLE_framebuffer_multisample::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_APPLE_framebuffer_multisample);
+
+ d->RenderbufferStorageMultisampleAPPLE = (void (QOPENGLF_APIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei))context->getProcAddress("glRenderbufferStorageMultisampleAPPLE");
+ d->ResolveMultisampleFramebufferAPPLE = (void (QOPENGLF_APIENTRYP)(void))context->getProcAddress("glResolveMultisampleFramebufferAPPLE");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_debug_label::QOpenGLExtension_EXT_debug_label()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_debug_labelPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_debug_label::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_debug_label);
+
+ d->LabelObjectEXT = (void (QOPENGLF_APIENTRYP)(GLenum type, GLuint object, GLsizei length, const GLchar *label))context->getProcAddress("glLabelObjectEXT");
+ d->GetObjectLabelEXT = (void (QOPENGLF_APIENTRYP)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label))context->getProcAddress("glGetObjectLabelEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_debug_marker::QOpenGLExtension_EXT_debug_marker()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_debug_markerPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_debug_marker::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_debug_marker);
+
+ d->InsertEventMarkerEXT = (void (QOPENGLF_APIENTRYP)(GLsizei length, const GLchar *marker))context->getProcAddress("glInsertEventMarkerEXT");
+ d->PushGroupMarkerEXT = (void (QOPENGLF_APIENTRYP)(GLsizei length, const GLchar *marker))context->getProcAddress("glPushGroupMarkerEXT");
+ d->PopGroupMarkerEXT = (void (QOPENGLF_APIENTRYP)(void))context->getProcAddress("glPopGroupMarkerEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_discard_framebuffer::QOpenGLExtension_EXT_discard_framebuffer()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_discard_framebufferPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_discard_framebuffer::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_discard_framebuffer);
+
+ d->DiscardFramebufferEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei numAttachments, const GLenum *attachments))context->getProcAddress("glDiscardFramebufferEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_multisampled_render_to_texture::QOpenGLExtension_EXT_multisampled_render_to_texture()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_multisampled_render_to_texturePrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_multisampled_render_to_texture::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_multisampled_render_to_texture);
+
+ d->RenderbufferStorageMultisampleEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height))context->getProcAddress("glRenderbufferStorageMultisampleEXT");
+ d->FramebufferTexture2DMultisampleEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples))context->getProcAddress("glFramebufferTexture2DMultisampleEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_multi_draw_arrays::QOpenGLExtension_EXT_multi_draw_arrays()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_multi_draw_arraysPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_multi_draw_arrays::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_multi_draw_arrays);
+
+ d->MultiDrawArraysEXT = (void (QOPENGLF_APIENTRYP)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount))context->getProcAddress("glMultiDrawArraysEXT");
+ d->MultiDrawElementsEXT = (void (QOPENGLF_APIENTRYP)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount))context->getProcAddress("glMultiDrawElementsEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_occlusion_query_boolean::QOpenGLExtension_EXT_occlusion_query_boolean()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_occlusion_query_booleanPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_occlusion_query_boolean::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+
+ d->GenQueriesEXT = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *ids))context->getProcAddress("glGenQueriesEXT");
+ d->DeleteQueriesEXT = (void (QOPENGLF_APIENTRYP)(GLsizei n, const GLuint *ids))context->getProcAddress("glDeleteQueriesEXT");
+ d->IsQueryEXT = (GLboolean (QOPENGLF_APIENTRYP)(GLuint id))context->getProcAddress("glIsQueryEXT");
+ d->BeginQueryEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLuint id))context->getProcAddress("glBeginQueryEXT");
+ d->EndQueryEXT = (void (QOPENGLF_APIENTRYP)(GLenum target))context->getProcAddress("glEndQueryEXT");
+ d->GetQueryivEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLenum pname, GLint *params))context->getProcAddress("glGetQueryivEXT");
+ d->GetQueryObjectuivEXT = (void (QOPENGLF_APIENTRYP)(GLuint id, GLenum pname, GLuint *params))context->getProcAddress("glGetQueryObjectuivEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_robustness::QOpenGLExtension_EXT_robustness()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_robustnessPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_robustness::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_robustness);
+
+ d->GetGraphicsResetStatusEXT = (GLenum (QOPENGLF_APIENTRYP)(void))context->getProcAddress("glGetGraphicsResetStatusEXT");
+ d->ReadnPixelsEXT = (void (QOPENGLF_APIENTRYP)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data))context->getProcAddress("glReadnPixelsEXT");
+ d->GetnUniformfvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei bufSize, float *params))context->getProcAddress("glGetnUniformfvEXT");
+ d->GetnUniformivEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei bufSize, GLint *params))context->getProcAddress("glGetnUniformivEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_separate_shader_objects::QOpenGLExtension_EXT_separate_shader_objects()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_separate_shader_objectsPrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_separate_shader_objects::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+
+ d->UseProgramStagesEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline, GLbitfield stages, GLuint program))context->getProcAddress("glUseProgramStagesEXT");
+ d->ActiveShaderProgramEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline, GLuint program))context->getProcAddress("glActiveShaderProgramEXT");
+ d->CreateShaderProgramvEXT = (GLuint (QOPENGLF_APIENTRYP)(GLenum type, GLsizei count, const GLchar **strings))context->getProcAddress("glCreateShaderProgramvEXT");
+ d->BindProgramPipelineEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline))context->getProcAddress("glBindProgramPipelineEXT");
+ d->DeleteProgramPipelinesEXT = (void (QOPENGLF_APIENTRYP)(GLsizei n, const GLuint *pipelines))context->getProcAddress("glDeleteProgramPipelinesEXT");
+ d->GenProgramPipelinesEXT = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *pipelines))context->getProcAddress("glGenProgramPipelinesEXT");
+ d->IsProgramPipelineEXT = (GLboolean (QOPENGLF_APIENTRYP)(GLuint pipeline))context->getProcAddress("glIsProgramPipelineEXT");
+ d->ProgramParameteriEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLenum pname, GLint value))context->getProcAddress("glProgramParameteriEXT");
+ d->GetProgramPipelineivEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline, GLenum pname, GLint *params))context->getProcAddress("glGetProgramPipelineivEXT");
+ d->ProgramUniform1iEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLint x))context->getProcAddress("glProgramUniform1iEXT");
+ d->ProgramUniform2iEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLint x, GLint y))context->getProcAddress("glProgramUniform2iEXT");
+ d->ProgramUniform3iEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLint x, GLint y, GLint z))context->getProcAddress("glProgramUniform3iEXT");
+ d->ProgramUniform4iEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w))context->getProcAddress("glProgramUniform4iEXT");
+ d->ProgramUniform1fEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLfloat x))context->getProcAddress("glProgramUniform1fEXT");
+ d->ProgramUniform2fEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLfloat x, GLfloat y))context->getProcAddress("glProgramUniform2fEXT");
+ d->ProgramUniform3fEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z))context->getProcAddress("glProgramUniform3fEXT");
+ d->ProgramUniform4fEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w))context->getProcAddress("glProgramUniform4fEXT");
+ d->ProgramUniform1ivEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLint *value))context->getProcAddress("glProgramUniform1ivEXT");
+ d->ProgramUniform2ivEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLint *value))context->getProcAddress("glProgramUniform2ivEXT");
+ d->ProgramUniform3ivEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLint *value))context->getProcAddress("glProgramUniform3ivEXT");
+ d->ProgramUniform4ivEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLint *value))context->getProcAddress("glProgramUniform4ivEXT");
+ d->ProgramUniform1fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLfloat *value))context->getProcAddress("glProgramUniform1fvEXT");
+ d->ProgramUniform2fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLfloat *value))context->getProcAddress("glProgramUniform2fvEXT");
+ d->ProgramUniform3fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLfloat *value))context->getProcAddress("glProgramUniform3fvEXT");
+ d->ProgramUniform4fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, const GLfloat *value))context->getProcAddress("glProgramUniform4fvEXT");
+ d->ProgramUniformMatrix2fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))context->getProcAddress("glProgramUniformMatrix2fvEXT");
+ d->ProgramUniformMatrix3fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))context->getProcAddress("glProgramUniformMatrix3fvEXT");
+ d->ProgramUniformMatrix4fvEXT = (void (QOPENGLF_APIENTRYP)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))context->getProcAddress("glProgramUniformMatrix4fvEXT");
+ d->ValidateProgramPipelineEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline))context->getProcAddress("glValidateProgramPipelineEXT");
+ d->GetProgramPipelineInfoLogEXT = (void (QOPENGLF_APIENTRYP)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog))context->getProcAddress("glGetProgramPipelineInfoLogEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_EXT_texture_storage::QOpenGLExtension_EXT_texture_storage()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_EXT_texture_storagePrivate))
+{
+}
+
+bool QOpenGLExtension_EXT_texture_storage::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+
+ d->TexStorage1DEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width))context->getProcAddress("glTexStorage1DEXT");
+ d->TexStorage2DEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height))context->getProcAddress("glTexStorage2DEXT");
+ d->TexStorage3DEXT = (void (QOPENGLF_APIENTRYP)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth))context->getProcAddress("glTexStorage3DEXT");
+ d->TextureStorage1DEXT = (void (QOPENGLF_APIENTRYP)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width))context->getProcAddress("glTextureStorage1DEXT");
+ d->TextureStorage2DEXT = (void (QOPENGLF_APIENTRYP)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height))context->getProcAddress("glTextureStorage2DEXT");
+ d->TextureStorage3DEXT = (void (QOPENGLF_APIENTRYP)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth))context->getProcAddress("glTextureStorage3DEXT");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_IMG_multisampled_render_to_texture::QOpenGLExtension_IMG_multisampled_render_to_texture()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_IMG_multisampled_render_to_texturePrivate))
+{
+}
+
+bool QOpenGLExtension_IMG_multisampled_render_to_texture::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_IMG_multisampled_render_to_texture);
+
+ d->RenderbufferStorageMultisampleIMG = (void (QOPENGLF_APIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei))context->getProcAddress("glRenderbufferStorageMultisampleIMG");
+ d->FramebufferTexture2DMultisampleIMG = (void (QOPENGLF_APIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei))context->getProcAddress("glFramebufferTexture2DMultisampleIMG");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_NV_coverage_sample::QOpenGLExtension_NV_coverage_sample()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_NV_coverage_samplePrivate))
+{
+}
+
+bool QOpenGLExtension_NV_coverage_sample::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_NV_coverage_sample);
+
+ d->CoverageMaskNV = (void (QOPENGLF_APIENTRYP)(GLboolean mask))context->getProcAddress("glCoverageMaskNV");
+ d->CoverageOperationNV = (void (QOPENGLF_APIENTRYP)(GLenum operation))context->getProcAddress("glCoverageOperationNV");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_NV_draw_buffers::QOpenGLExtension_NV_draw_buffers()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_NV_draw_buffersPrivate))
+{
+}
+
+bool QOpenGLExtension_NV_draw_buffers::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_NV_draw_buffers);
+
+ d->DrawBuffersNV = (void (QOPENGLF_APIENTRYP)(GLsizei n, const GLenum *bufs))context->getProcAddress("glDrawBuffersNV");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_NV_fence::QOpenGLExtension_NV_fence()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_NV_fencePrivate))
+{
+}
+
+bool QOpenGLExtension_NV_fence::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_NV_fence);
+
+ d->DeleteFencesNV = (void (QOPENGLF_APIENTRYP)(GLsizei n, const GLuint *fences))context->getProcAddress("glDeleteFencesNV");
+ d->GenFencesNV = (void (QOPENGLF_APIENTRYP)(GLsizei n, GLuint *fences))context->getProcAddress("glGenFencesNV");
+ d->IsFenceNV = (GLboolean (QOPENGLF_APIENTRYP)(GLuint fence))context->getProcAddress("glIsFenceNV");
+ d->TestFenceNV = (GLboolean (QOPENGLF_APIENTRYP)(GLuint fence))context->getProcAddress("glTestFenceNV");
+ d->GetFenceivNV = (void (QOPENGLF_APIENTRYP)(GLuint fence, GLenum pname, GLint *params))context->getProcAddress("glGetFenceivNV");
+ d->FinishFenceNV = (void (QOPENGLF_APIENTRYP)(GLuint fence))context->getProcAddress("glFinishFenceNV");
+ d->SetFenceNV = (void (QOPENGLF_APIENTRYP)(GLuint fence, GLenum condition))context->getProcAddress("glSetFenceNV");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_NV_read_buffer::QOpenGLExtension_NV_read_buffer()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_NV_read_bufferPrivate))
+{
+}
+
+bool QOpenGLExtension_NV_read_buffer::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_NV_read_buffer);
+
+ d->ReadBufferNV = (void (QOPENGLF_APIENTRYP)(GLenum mode))context->getProcAddress("glReadBufferNV");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_QCOM_alpha_test::QOpenGLExtension_QCOM_alpha_test()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_QCOM_alpha_testPrivate))
+{
+}
+
+bool QOpenGLExtension_QCOM_alpha_test::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_QCOM_alpha_test);
+
+ d->AlphaFuncQCOM = (void (QOPENGLF_APIENTRYP )(GLenum func, GLclampf ref))context->getProcAddress("glAlphaFuncQCOM");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_QCOM_driver_control::QOpenGLExtension_QCOM_driver_control()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_QCOM_driver_controlPrivate))
+{
+}
+
+bool QOpenGLExtension_QCOM_driver_control::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_QCOM_driver_control);
+
+ d->GetDriverControlsQCOM = (void (QOPENGLF_APIENTRYP)(GLint *num, GLsizei size, GLuint *driverControls))context->getProcAddress("glGetDriverControlsQCOM");
+ d->GetDriverControlStringQCOM = (void (QOPENGLF_APIENTRYP)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString))context->getProcAddress("glGetDriverControlStringQCOM");
+ d->EnableDriverControlQCOM = (void (QOPENGLF_APIENTRYP)(GLuint driverControl))context->getProcAddress("glEnableDriverControlQCOM");
+ d->DisableDriverControlQCOM = (void (QOPENGLF_APIENTRYP)(GLuint driverControl))context->getProcAddress("glDisableDriverControlQCOM");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_QCOM_extended_get::QOpenGLExtension_QCOM_extended_get()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_QCOM_extended_getPrivate))
+{
+}
+
+bool QOpenGLExtension_QCOM_extended_get::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+
+ d->ExtGetTexturesQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *textures, GLint maxTextures, GLint *numTextures))context->getProcAddress("glExtGetTexturesQCOM");
+ d->ExtGetBuffersQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers))context->getProcAddress("glExtGetBuffersQCOM");
+ d->ExtGetRenderbuffersQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers))context->getProcAddress("glExtGetRenderbuffersQCOM");
+ d->ExtGetFramebuffersQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers))context->getProcAddress("glExtGetFramebuffersQCOM");
+ d->ExtGetTexLevelParameterivQCOM = (void (QOPENGLF_APIENTRYP)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params))context->getProcAddress("glExtGetTexLevelParameterivQCOM");
+ d->ExtTexObjectStateOverrideiQCOM = (void (QOPENGLF_APIENTRYP)(GLenum target, GLenum pname, GLint param))context->getProcAddress("glExtTexObjectStateOverrideiQCOM");
+ d->ExtGetTexSubImageQCOM = (void (QOPENGLF_APIENTRYP)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels))context->getProcAddress("glExtGetTexSubImageQCOM");
+ d->ExtGetBufferPointervQCOM = (void (QOPENGLF_APIENTRYP)(GLenum target, GLvoid **params))context->getProcAddress("glExtGetBufferPointervQCOM");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_QCOM_extended_get2::QOpenGLExtension_QCOM_extended_get2()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_QCOM_extended_get2Private))
+{
+}
+
+bool QOpenGLExtension_QCOM_extended_get2::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_QCOM_extended_get2);
+
+ d->ExtGetShadersQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *shaders, GLint maxShaders, GLint *numShaders))context->getProcAddress("glExtGetShadersQCOM");
+ d->ExtGetProgramsQCOM = (void (QOPENGLF_APIENTRYP)(GLuint *programs, GLint maxPrograms, GLint *numPrograms))context->getProcAddress("glExtGetProgramsQCOM");
+ d->ExtIsProgramBinaryQCOM = (GLboolean (QOPENGLF_APIENTRYP)(GLuint program))context->getProcAddress("glExtIsProgramBinaryQCOM");
+ d->ExtGetProgramBinarySourceQCOM = (void (QOPENGLF_APIENTRYP)(GLuint program, GLenum shadertype, GLchar *source, GLint *length))context->getProcAddress("glExtGetProgramBinarySourceQCOM");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+QOpenGLExtension_QCOM_tiled_rendering::QOpenGLExtension_QCOM_tiled_rendering()
+ : QAbstractOpenGLExtension(*(new QOpenGLExtension_QCOM_tiled_renderingPrivate))
+{
+}
+
+bool QOpenGLExtension_QCOM_tiled_rendering::initializeOpenGLFunctions()
+{
+ if (isInitialized())
+ return true;
+
+ QOpenGLContext *context = QOpenGLContext::currentContext();
+ if (!context) {
+ qWarning("A current OpenGL context is required to resolve OpenGL extension functions");
+ return false;
+ }
+
+ // Resolve the functions
+ Q_D(QOpenGLExtension_QCOM_tiled_rendering);
+
+ d->StartTilingQCOM = (void (QOPENGLF_APIENTRYP)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask))context->getProcAddress("glStartTilingQCOM");
+ d->EndTilingQCOM = (void (QOPENGLF_APIENTRYP)(GLbitfield preserveMask))context->getProcAddress("glEndTilingQCOM");
+ return QAbstractOpenGLExtension::initializeOpenGLFunctions();
+}
+
+#endif
+
+QT_END_NAMESPACE
+
diff --git a/util/glgen/qopenglextensions.cpp.header b/util/glgen/qopenglextensions.cpp.header
new file mode 100644
index 0000000000..6a9f639d5d
--- /dev/null
+++ b/util/glgen/qopenglextensions.cpp.header
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#include "qopenglextensions.h"
+#include <QtGui/qopenglcontext.h>
+
+QT_BEGIN_NAMESPACE
+
+QAbstractOpenGLExtension::~QAbstractOpenGLExtension()
+{
+ if (d_ptr)
+ delete d_ptr;
+}
+
+bool QAbstractOpenGLExtension::initializeOpenGLFunctions()
+{
+ Q_D(QAbstractOpenGLExtension);
+ d->initialized = true;
+ return true;
+}
+
+bool QAbstractOpenGLExtension::isInitialized() const
+{
+ Q_D(const QAbstractOpenGLExtension);
+ return d->initialized;
+}
+
+#if !defined(QT_OPENGL_ES_2)
+
diff --git a/util/glgen/qopenglextensions.h.footer b/util/glgen/qopenglextensions.h.footer
new file mode 100644
index 0000000000..b8a8e6f267
--- /dev/null
+++ b/util/glgen/qopenglextensions.h.footer
@@ -0,0 +1,1520 @@
+
+#else
+
+class QOpenGLExtension_OES_EGL_imagePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES image);
+ void (QOPENGLF_APIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_OES_EGL_image : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_OES_EGL_image();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
+ void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_OES_EGL_image)
+};
+
+inline void QOpenGLExtension_OES_EGL_image::glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
+{
+ Q_D(QOpenGLExtension_OES_EGL_image);
+ d->EGLImageTargetTexture2DOES(target, image);
+}
+
+inline void QOpenGLExtension_OES_EGL_image::glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
+{
+ Q_D(QOpenGLExtension_OES_EGL_image);
+ d->EGLImageTargetRenderbufferStorageOES(target, image);
+}
+
+class QOpenGLExtension_OES_get_program_binaryPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP GetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+ void (QOPENGLF_APIENTRYP ProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_OES_get_program_binary : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_OES_get_program_binary();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
+ void glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_OES_get_program_binary)
+};
+
+inline void QOpenGLExtension_OES_get_program_binary::glGetProgramBinaryOES(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary)
+{
+ Q_D(QOpenGLExtension_OES_get_program_binary);
+ d->GetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
+}
+
+inline void QOpenGLExtension_OES_get_program_binary::glProgramBinaryOES(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length)
+{
+ Q_D(QOpenGLExtension_OES_get_program_binary);
+ d->ProgramBinaryOES(program, binaryFormat, binary, length);
+}
+
+class QOpenGLExtension_OES_mapbufferPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void* (QOPENGLF_APIENTRYP MapBufferOES)(GLenum target, GLenum access);
+ GLboolean (QOPENGLF_APIENTRYP UnmapBufferOES)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetBufferPointervOES)(GLenum target, GLenum pname, GLvoid** params);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_OES_mapbuffer : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_OES_mapbuffer();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void* glMapBufferOES(GLenum target, GLenum access);
+ GLboolean glUnmapBufferOES(GLenum target);
+ void glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_OES_mapbuffer)
+};
+
+inline void *QOpenGLExtension_OES_mapbuffer::glMapBufferOES(GLenum target, GLenum access)
+{
+ Q_D(QOpenGLExtension_OES_mapbuffer);
+ return d->MapBufferOES(target, access);
+}
+
+inline GLboolean QOpenGLExtension_OES_mapbuffer::glUnmapBufferOES(GLenum target)
+{
+ Q_D(QOpenGLExtension_OES_mapbuffer);
+ return d->UnmapBufferOES(target);
+}
+
+inline void QOpenGLExtension_OES_mapbuffer::glGetBufferPointervOES(GLenum target, GLenum pname, GLvoid** params)
+{
+ Q_D(QOpenGLExtension_OES_mapbuffer);
+ d->GetBufferPointervOES(target, pname, params);
+}
+
+class QOpenGLExtension_OES_texture_3DPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP TexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+ void (QOPENGLF_APIENTRYP TexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+ void (QOPENGLF_APIENTRYP CopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP CompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+ void (QOPENGLF_APIENTRYP CompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+ void (QOPENGLF_APIENTRYP FramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_OES_texture_3D : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_OES_texture_3D();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+ void glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
+ void glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+ void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+ void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
+ void glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_OES_texture_3D)
+};
+
+inline void QOpenGLExtension_OES_texture_3D::glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->TexImage3DOES(target, level, internalformat, width, height, depth, border, format, type, pixels);
+}
+
+inline void QOpenGLExtension_OES_texture_3D::glTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->TexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+}
+
+inline void QOpenGLExtension_OES_texture_3D::glCopyTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->CopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+inline void QOpenGLExtension_OES_texture_3D::glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->CompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+inline void QOpenGLExtension_OES_texture_3D::glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->CompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+inline void QOpenGLExtension_OES_texture_3D::glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
+{
+ Q_D(QOpenGLExtension_OES_texture_3D);
+ d->FramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
+}
+
+class QOpenGLExtension_OES_vertex_array_objectPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP BindVertexArrayOES)(GLuint array);
+ void (QOPENGLF_APIENTRYP DeleteVertexArraysOES)(GLsizei n, const GLuint *arrays);
+ void (QOPENGLF_APIENTRYP GenVertexArraysOES)(GLsizei n, GLuint *arrays);
+ GLboolean (QOPENGLF_APIENTRYP IsVertexArrayOES)(GLuint array);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_OES_vertex_array_object : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_OES_vertex_array_object();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glBindVertexArrayOES(GLuint array);
+ void glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays);
+ void glGenVertexArraysOES(GLsizei n, GLuint *arrays);
+ GLboolean glIsVertexArrayOES(GLuint array);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_OES_vertex_array_object)
+};
+
+inline void QOpenGLExtension_OES_vertex_array_object::glBindVertexArrayOES(GLuint array)
+{
+ Q_D(QOpenGLExtension_OES_vertex_array_object);
+ d->BindVertexArrayOES(array);
+}
+
+inline void QOpenGLExtension_OES_vertex_array_object::glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
+{
+ Q_D(QOpenGLExtension_OES_vertex_array_object);
+ d->DeleteVertexArraysOES(n, arrays);
+}
+
+inline void QOpenGLExtension_OES_vertex_array_object::glGenVertexArraysOES(GLsizei n, GLuint *arrays)
+{
+ Q_D(QOpenGLExtension_OES_vertex_array_object);
+ d->GenVertexArraysOES(n, arrays);
+}
+
+inline GLboolean QOpenGLExtension_OES_vertex_array_object::glIsVertexArrayOES(GLuint array)
+{
+ Q_D(QOpenGLExtension_OES_vertex_array_object);
+ return d->IsVertexArrayOES(array);
+}
+
+class QOpenGLExtension_AMD_performance_monitorPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP GetPerfMonitorGroupsAMD)(GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+ void (QOPENGLF_APIENTRYP GetPerfMonitorCountersAMD)(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+ void (QOPENGLF_APIENTRYP GetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+ void (QOPENGLF_APIENTRYP GetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+ void (QOPENGLF_APIENTRYP GetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+ void (QOPENGLF_APIENTRYP GenPerfMonitorsAMD)(GLsizei n, GLuint *monitors);
+ void (QOPENGLF_APIENTRYP DeletePerfMonitorsAMD)(GLsizei n, GLuint *monitors);
+ void (QOPENGLF_APIENTRYP SelectPerfMonitorCountersAMD)(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+ void (QOPENGLF_APIENTRYP BeginPerfMonitorAMD)(GLuint monitor);
+ void (QOPENGLF_APIENTRYP EndPerfMonitorAMD)(GLuint monitor);
+ void (QOPENGLF_APIENTRYP GetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_AMD_performance_monitor : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_AMD_performance_monitor();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+ void glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+ void glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+ void glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+ void glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data);
+ void glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors);
+ void glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors);
+ void glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+ void glBeginPerfMonitorAMD(GLuint monitor);
+ void glEndPerfMonitorAMD(GLuint monitor);
+ void glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_AMD_performance_monitor)
+};
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorGroupsAMD(GLint *numGroups, GLsizei groupsSize, GLuint *groups)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorGroupsAMD(numGroups, groupsSize, groups);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorCountersAMD(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorGroupStringAMD(group, bufSize, length, groupString);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid *data)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorCounterInfoAMD(group, counter, pname, data);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGenPerfMonitorsAMD(GLsizei n, GLuint *monitors)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GenPerfMonitorsAMD(n, monitors);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glDeletePerfMonitorsAMD(GLsizei n, GLuint *monitors)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->DeletePerfMonitorsAMD(n, monitors);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glSelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->SelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, countersList);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glBeginPerfMonitorAMD(GLuint monitor)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->BeginPerfMonitorAMD(monitor);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glEndPerfMonitorAMD(GLuint monitor)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->EndPerfMonitorAMD(monitor);
+}
+
+inline void QOpenGLExtension_AMD_performance_monitor::glGetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten)
+{
+ Q_D(QOpenGLExtension_AMD_performance_monitor);
+ d->GetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten);
+}
+
+class QOpenGLExtension_ANGLE_framebuffer_blitPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP BlitFramebufferANGLE)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_ANGLE_framebuffer_blit : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_ANGLE_framebuffer_blit();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_ANGLE_framebuffer_blit)
+};
+
+inline void QOpenGLExtension_ANGLE_framebuffer_blit::glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+ Q_D(QOpenGLExtension_ANGLE_framebuffer_blit);
+ d->BlitFramebufferANGLE(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+class QOpenGLExtension_ANGLE_framebuffer_multisamplePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisampleANGLE)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_ANGLE_framebuffer_multisample : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_ANGLE_framebuffer_multisample();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_ANGLE_framebuffer_multisample)
+};
+
+inline void QOpenGLExtension_ANGLE_framebuffer_multisample::glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_ANGLE_framebuffer_multisample);
+ d->RenderbufferStorageMultisampleANGLE(target, samples, internalformat, width, height);
+}
+
+class QOpenGLExtension_ANGLE_instanced_arraysPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP DrawArraysInstancedANGLE)(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+ void (QOPENGLF_APIENTRYP DrawElementsInstancedANGLE)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+ void (QOPENGLF_APIENTRYP VertexAttribDivisorANGLE)(GLuint index, GLuint divisor);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_ANGLE_instanced_arrays : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_ANGLE_instanced_arrays();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+ void glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+ void glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_ANGLE_instanced_arrays)
+};
+
+inline void QOpenGLExtension_ANGLE_instanced_arrays::glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+ Q_D(QOpenGLExtension_ANGLE_instanced_arrays);
+ d->DrawArraysInstancedANGLE(mode, first, count, primcount);
+}
+
+inline void QOpenGLExtension_ANGLE_instanced_arrays::glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount)
+{
+ Q_D(QOpenGLExtension_ANGLE_instanced_arrays);
+ d->DrawElementsInstancedANGLE(mode, count, type, indices, primcount);
+}
+
+inline void QOpenGLExtension_ANGLE_instanced_arrays::glVertexAttribDivisorANGLE(GLuint index, GLuint divisor)
+{
+ Q_D(QOpenGLExtension_ANGLE_instanced_arrays);
+ d->VertexAttribDivisorANGLE(index, divisor);
+}
+
+class QOpenGLExtension_ANGLE_translated_shader_sourcePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP GetTranslatedShaderSourceANGLE)(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_ANGLE_translated_shader_source : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_ANGLE_translated_shader_source();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_ANGLE_translated_shader_source)
+};
+
+inline void QOpenGLExtension_ANGLE_translated_shader_source::glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source)
+{
+ Q_D(QOpenGLExtension_ANGLE_translated_shader_source);
+ d->GetTranslatedShaderSourceANGLE(shader, bufsize, length, source);
+}
+
+class QOpenGLExtension_APPLE_framebuffer_multisamplePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisampleAPPLE)(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+ void (QOPENGLF_APIENTRYP ResolveMultisampleFramebufferAPPLE)(void);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_APPLE_framebuffer_multisample : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_APPLE_framebuffer_multisample();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void glResolveMultisampleFramebufferAPPLE(void);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_APPLE_framebuffer_multisample)
+};
+
+inline void QOpenGLExtension_APPLE_framebuffer_multisample::glRenderbufferStorageMultisampleAPPLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_APPLE_framebuffer_multisample);
+ d->RenderbufferStorageMultisampleAPPLE(target, samples, internalformat, width, height);
+}
+
+inline void QOpenGLExtension_APPLE_framebuffer_multisample::glResolveMultisampleFramebufferAPPLE(void)
+{
+ Q_D(QOpenGLExtension_APPLE_framebuffer_multisample);
+ d->ResolveMultisampleFramebufferAPPLE();
+}
+
+class QOpenGLExtension_EXT_debug_labelPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP LabelObjectEXT)(GLenum type, GLuint object, GLsizei length, const GLchar *label);
+ void (QOPENGLF_APIENTRYP GetObjectLabelEXT)(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_debug_label : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_debug_label();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label);
+ void glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_debug_label)
+};
+
+inline void QOpenGLExtension_EXT_debug_label::glLabelObjectEXT(GLenum type, GLuint object, GLsizei length, const GLchar *label)
+{
+ Q_D(QOpenGLExtension_EXT_debug_label);
+ d->LabelObjectEXT(type, object, length, label);
+}
+
+inline void QOpenGLExtension_EXT_debug_label::glGetObjectLabelEXT(GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label)
+{
+ Q_D(QOpenGLExtension_EXT_debug_label);
+ d->GetObjectLabelEXT(type, object, bufSize, length, label);
+}
+
+class QOpenGLExtension_EXT_debug_markerPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP InsertEventMarkerEXT)(GLsizei length, const GLchar *marker);
+ void (QOPENGLF_APIENTRYP PushGroupMarkerEXT)(GLsizei length, const GLchar *marker);
+ void (QOPENGLF_APIENTRYP PopGroupMarkerEXT)(void);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_debug_marker : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_debug_marker();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glInsertEventMarkerEXT(GLsizei length, const GLchar *marker);
+ void glPushGroupMarkerEXT(GLsizei length, const GLchar *marker);
+ void glPopGroupMarkerEXT(void);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_debug_marker)
+};
+
+inline void QOpenGLExtension_EXT_debug_marker::glInsertEventMarkerEXT(GLsizei length, const GLchar *marker)
+{
+ Q_D(QOpenGLExtension_EXT_debug_marker);
+ d->InsertEventMarkerEXT(length, marker);
+}
+
+inline void QOpenGLExtension_EXT_debug_marker::glPushGroupMarkerEXT(GLsizei length, const GLchar *marker)
+{
+ Q_D(QOpenGLExtension_EXT_debug_marker);
+ d->PushGroupMarkerEXT(length, marker);
+}
+
+inline void QOpenGLExtension_EXT_debug_marker::glPopGroupMarkerEXT(void)
+{
+ Q_D(QOpenGLExtension_EXT_debug_marker);
+ d->PopGroupMarkerEXT();
+}
+
+class QOpenGLExtension_EXT_discard_framebufferPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP DiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_discard_framebuffer : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_discard_framebuffer();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_discard_framebuffer)
+};
+
+inline void QOpenGLExtension_EXT_discard_framebuffer::glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments)
+{
+ Q_D(QOpenGLExtension_EXT_discard_framebuffer);
+ d->DiscardFramebufferEXT(target, numAttachments, attachments);
+}
+
+class QOpenGLExtension_EXT_multisampled_render_to_texturePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP FramebufferTexture2DMultisampleEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_multisampled_render_to_texture : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_multisampled_render_to_texture();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_multisampled_render_to_texture)
+};
+
+inline void QOpenGLExtension_EXT_multisampled_render_to_texture::glRenderbufferStorageMultisampleEXT(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_EXT_multisampled_render_to_texture);
+ d->RenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height);
+}
+
+inline void QOpenGLExtension_EXT_multisampled_render_to_texture::glFramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+ Q_D(QOpenGLExtension_EXT_multisampled_render_to_texture);
+ d->FramebufferTexture2DMultisampleEXT(target, attachment, textarget, texture, level, samples);
+}
+
+class QOpenGLExtension_EXT_multi_draw_arraysPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+ void (QOPENGLF_APIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_multi_draw_arrays : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_multi_draw_arrays();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+ void glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_multi_draw_arrays)
+};
+
+inline void QOpenGLExtension_EXT_multi_draw_arrays::glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount)
+{
+ Q_D(QOpenGLExtension_EXT_multi_draw_arrays);
+ d->MultiDrawArraysEXT(mode, first, count, primcount);
+}
+
+inline void QOpenGLExtension_EXT_multi_draw_arrays::glMultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount)
+{
+ Q_D(QOpenGLExtension_EXT_multi_draw_arrays);
+ d->MultiDrawElementsEXT(mode, count, type, indices, primcount);
+}
+
+class QOpenGLExtension_EXT_occlusion_query_booleanPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP GenQueriesEXT)(GLsizei n, GLuint *ids);
+ void (QOPENGLF_APIENTRYP DeleteQueriesEXT)(GLsizei n, const GLuint *ids);
+ GLboolean (QOPENGLF_APIENTRYP IsQueryEXT)(GLuint id);
+ void (QOPENGLF_APIENTRYP BeginQueryEXT)(GLenum target, GLuint id);
+ void (QOPENGLF_APIENTRYP EndQueryEXT)(GLenum target);
+ void (QOPENGLF_APIENTRYP GetQueryivEXT)(GLenum target, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP GetQueryObjectuivEXT)(GLuint id, GLenum pname, GLuint *params);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_occlusion_query_boolean : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_occlusion_query_boolean();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glGenQueriesEXT(GLsizei n, GLuint *ids);
+ void glDeleteQueriesEXT(GLsizei n, const GLuint *ids);
+ GLboolean glIsQueryEXT(GLuint id);
+ void glBeginQueryEXT(GLenum target, GLuint id);
+ void glEndQueryEXT(GLenum target);
+ void glGetQueryivEXT(GLenum target, GLenum pname, GLint *params);
+ void glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_occlusion_query_boolean)
+};
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glGenQueriesEXT(GLsizei n, GLuint *ids)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->GenQueriesEXT(n, ids);
+}
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glDeleteQueriesEXT(GLsizei n, const GLuint *ids)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->DeleteQueriesEXT(n, ids);
+}
+
+inline GLboolean QOpenGLExtension_EXT_occlusion_query_boolean::glIsQueryEXT(GLuint id)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ return d->IsQueryEXT(id);
+}
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glBeginQueryEXT(GLenum target, GLuint id)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->BeginQueryEXT(target, id);
+}
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glEndQueryEXT(GLenum target)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->EndQueryEXT(target);
+}
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glGetQueryivEXT(GLenum target, GLenum pname, GLint *params)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->GetQueryivEXT(target, pname, params);
+}
+
+inline void QOpenGLExtension_EXT_occlusion_query_boolean::glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params)
+{
+ Q_D(QOpenGLExtension_EXT_occlusion_query_boolean);
+ d->GetQueryObjectuivEXT(id, pname, params);
+}
+
+class QOpenGLExtension_EXT_robustnessPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ GLenum (QOPENGLF_APIENTRYP GetGraphicsResetStatusEXT)(void);
+ void (QOPENGLF_APIENTRYP ReadnPixelsEXT)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+ void (QOPENGLF_APIENTRYP GetnUniformfvEXT)(GLuint program, GLint location, GLsizei bufSize, float *params);
+ void (QOPENGLF_APIENTRYP GetnUniformivEXT)(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_robustness : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_robustness();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ GLenum glGetGraphicsResetStatusEXT(void);
+ void glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+ void glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params);
+ void glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_robustness)
+};
+
+inline GLenum QOpenGLExtension_EXT_robustness::glGetGraphicsResetStatusEXT(void)
+{
+ Q_D(QOpenGLExtension_EXT_robustness);
+ return d->GetGraphicsResetStatusEXT();
+}
+
+inline void QOpenGLExtension_EXT_robustness::glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data)
+{
+ Q_D(QOpenGLExtension_EXT_robustness);
+ d->ReadnPixelsEXT(x, y, width, height, format, type, bufSize, data);
+}
+
+inline void QOpenGLExtension_EXT_robustness::glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, float *params)
+{
+ Q_D(QOpenGLExtension_EXT_robustness);
+ d->GetnUniformfvEXT(program, location, bufSize, params);
+}
+
+inline void QOpenGLExtension_EXT_robustness::glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint *params)
+{
+ Q_D(QOpenGLExtension_EXT_robustness);
+ d->GetnUniformivEXT(program, location, bufSize, params);
+}
+
+class QOpenGLExtension_EXT_separate_shader_objectsPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP UseProgramStagesEXT)(GLuint pipeline, GLbitfield stages, GLuint program);
+ void (QOPENGLF_APIENTRYP ActiveShaderProgramEXT)(GLuint pipeline, GLuint program);
+ GLuint (QOPENGLF_APIENTRYP CreateShaderProgramvEXT)(GLenum type, GLsizei count, const GLchar **strings);
+ void (QOPENGLF_APIENTRYP BindProgramPipelineEXT)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP DeleteProgramPipelinesEXT)(GLsizei n, const GLuint *pipelines);
+ void (QOPENGLF_APIENTRYP GenProgramPipelinesEXT)(GLsizei n, GLuint *pipelines);
+ GLboolean (QOPENGLF_APIENTRYP IsProgramPipelineEXT)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP ProgramParameteriEXT)(GLuint program, GLenum pname, GLint value);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineivEXT)(GLuint pipeline, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP ProgramUniform1iEXT)(GLuint program, GLint location, GLint x);
+ void (QOPENGLF_APIENTRYP ProgramUniform2iEXT)(GLuint program, GLint location, GLint x, GLint y);
+ void (QOPENGLF_APIENTRYP ProgramUniform3iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z);
+ void (QOPENGLF_APIENTRYP ProgramUniform4iEXT)(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+ void (QOPENGLF_APIENTRYP ProgramUniform1fEXT)(GLuint program, GLint location, GLfloat x);
+ void (QOPENGLF_APIENTRYP ProgramUniform2fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y);
+ void (QOPENGLF_APIENTRYP ProgramUniform3fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+ void (QOPENGLF_APIENTRYP ProgramUniform4fEXT)(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ void (QOPENGLF_APIENTRYP ProgramUniform1ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4ivEXT)(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform1fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform2fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform3fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniform4fvEXT)(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix2fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix3fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ProgramUniformMatrix4fvEXT)(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void (QOPENGLF_APIENTRYP ValidateProgramPipelineEXT)(GLuint pipeline);
+ void (QOPENGLF_APIENTRYP GetProgramPipelineInfoLogEXT)(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_separate_shader_objects : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_separate_shader_objects();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program);
+ void glActiveShaderProgramEXT(GLuint pipeline, GLuint program);
+ GLuint glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings);
+ void glBindProgramPipelineEXT(GLuint pipeline);
+ void glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines);
+ void glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines);
+ GLboolean glIsProgramPipelineEXT(GLuint pipeline);
+ void glProgramParameteriEXT(GLuint program, GLenum pname, GLint value);
+ void glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params);
+ void glProgramUniform1iEXT(GLuint program, GLint location, GLint x);
+ void glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y);
+ void glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z);
+ void glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
+ void glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x);
+ void glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y);
+ void glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
+ void glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+ void glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value);
+ void glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value);
+ void glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+ void glValidateProgramPipelineEXT(GLuint pipeline);
+ void glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_separate_shader_objects)
+};
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glUseProgramStagesEXT(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->UseProgramStagesEXT(pipeline, stages, program);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glActiveShaderProgramEXT(GLuint pipeline, GLuint program)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ActiveShaderProgramEXT(pipeline, program);
+}
+
+inline GLuint QOpenGLExtension_EXT_separate_shader_objects::glCreateShaderProgramvEXT(GLenum type, GLsizei count, const GLchar **strings)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ return d->CreateShaderProgramvEXT(type, count, strings);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glBindProgramPipelineEXT(GLuint pipeline)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->BindProgramPipelineEXT(pipeline);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glDeleteProgramPipelinesEXT(GLsizei n, const GLuint *pipelines)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->DeleteProgramPipelinesEXT(n, pipelines);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glGenProgramPipelinesEXT(GLsizei n, GLuint *pipelines)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->GenProgramPipelinesEXT(n, pipelines);
+}
+
+inline GLboolean QOpenGLExtension_EXT_separate_shader_objects::glIsProgramPipelineEXT(GLuint pipeline)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ return d->IsProgramPipelineEXT(pipeline);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramParameteriEXT(GLuint program, GLenum pname, GLint value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramParameteriEXT(program, pname, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glGetProgramPipelineivEXT(GLuint pipeline, GLenum pname, GLint *params)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->GetProgramPipelineivEXT(pipeline, pname, params);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform1iEXT(GLuint program, GLint location, GLint x)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform1iEXT(program, location, x);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform2iEXT(GLuint program, GLint location, GLint x, GLint y)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform2iEXT(program, location, x, y);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform3iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform3iEXT(program, location, x, y, z);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform4iEXT(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform4iEXT(program, location, x, y, z, w);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform1fEXT(GLuint program, GLint location, GLfloat x)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform1fEXT(program, location, x);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform2fEXT(GLuint program, GLint location, GLfloat x, GLfloat y)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform2fEXT(program, location, x, y);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform3fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform3fEXT(program, location, x, y, z);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform4fEXT(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform4fEXT(program, location, x, y, z, w);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform1ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform1ivEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform2ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform2ivEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform3ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform3ivEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform4ivEXT(GLuint program, GLint location, GLsizei count, const GLint *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform4ivEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform1fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform1fvEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform2fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform2fvEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform3fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform3fvEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniform4fvEXT(GLuint program, GLint location, GLsizei count, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniform4fvEXT(program, location, count, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniformMatrix2fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniformMatrix2fvEXT(program, location, count, transpose, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniformMatrix3fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniformMatrix3fvEXT(program, location, count, transpose, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glProgramUniformMatrix4fvEXT(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ProgramUniformMatrix4fvEXT(program, location, count, transpose, value);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glValidateProgramPipelineEXT(GLuint pipeline)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->ValidateProgramPipelineEXT(pipeline);
+}
+
+inline void QOpenGLExtension_EXT_separate_shader_objects::glGetProgramPipelineInfoLogEXT(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
+{
+ Q_D(QOpenGLExtension_EXT_separate_shader_objects);
+ d->GetProgramPipelineInfoLogEXT(pipeline, bufSize, length, infoLog);
+}
+
+class QOpenGLExtension_EXT_texture_storagePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP TexStorage1DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ void (QOPENGLF_APIENTRYP TexStorage2DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TexStorage3DEXT)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void (QOPENGLF_APIENTRYP TextureStorage1DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ void (QOPENGLF_APIENTRYP TextureStorage2DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void (QOPENGLF_APIENTRYP TextureStorage3DEXT)(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_EXT_texture_storage : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_EXT_texture_storage();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ void glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+ void glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+ void glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_EXT_texture_storage)
+};
+
+inline void QOpenGLExtension_EXT_texture_storage::glTexStorage1DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TexStorage1DEXT(target, levels, internalformat, width);
+}
+
+inline void QOpenGLExtension_EXT_texture_storage::glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TexStorage2DEXT(target, levels, internalformat, width, height);
+}
+
+inline void QOpenGLExtension_EXT_texture_storage::glTexStorage3DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TexStorage3DEXT(target, levels, internalformat, width, height, depth);
+}
+
+inline void QOpenGLExtension_EXT_texture_storage::glTextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TextureStorage1DEXT(texture, target, levels, internalformat, width);
+}
+
+inline void QOpenGLExtension_EXT_texture_storage::glTextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TextureStorage2DEXT(texture, target, levels, internalformat, width, height);
+}
+
+inline void QOpenGLExtension_EXT_texture_storage::glTextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+ Q_D(QOpenGLExtension_EXT_texture_storage);
+ d->TextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
+}
+
+class QOpenGLExtension_IMG_multisampled_render_to_texturePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP RenderbufferStorageMultisampleIMG)(GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+ void (QOPENGLF_APIENTRYP FramebufferTexture2DMultisampleIMG)(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_IMG_multisampled_render_to_texture : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_IMG_multisampled_render_to_texture();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+ void glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_IMG_multisampled_render_to_texture)
+};
+
+inline void QOpenGLExtension_IMG_multisampled_render_to_texture::glRenderbufferStorageMultisampleIMG(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ Q_D(QOpenGLExtension_IMG_multisampled_render_to_texture);
+ d->RenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
+}
+
+inline void QOpenGLExtension_IMG_multisampled_render_to_texture::glFramebufferTexture2DMultisampleIMG(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)
+{
+ Q_D(QOpenGLExtension_IMG_multisampled_render_to_texture);
+ d->FramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
+}
+
+class QOpenGLExtension_NV_coverage_samplePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP CoverageMaskNV)(GLboolean mask);
+ void (QOPENGLF_APIENTRYP CoverageOperationNV)(GLenum operation);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_NV_coverage_sample : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_NV_coverage_sample();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glCoverageMaskNV(GLboolean mask);
+ void glCoverageOperationNV(GLenum operation);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_NV_coverage_sample)
+};
+
+inline void QOpenGLExtension_NV_coverage_sample::glCoverageMaskNV(GLboolean mask)
+{
+ Q_D(QOpenGLExtension_NV_coverage_sample);
+ d->CoverageMaskNV(mask);
+}
+
+inline void QOpenGLExtension_NV_coverage_sample::glCoverageOperationNV(GLenum operation)
+{
+ Q_D(QOpenGLExtension_NV_coverage_sample);
+ d->CoverageOperationNV(operation);
+}
+
+class QOpenGLExtension_NV_draw_buffersPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP DrawBuffersNV)(GLsizei n, const GLenum *bufs);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_NV_draw_buffers : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_NV_draw_buffers();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glDrawBuffersNV(GLsizei n, const GLenum *bufs);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_NV_draw_buffers)
+};
+
+inline void QOpenGLExtension_NV_draw_buffers::glDrawBuffersNV(GLsizei n, const GLenum *bufs)
+{
+ Q_D(QOpenGLExtension_NV_draw_buffers);
+ d->DrawBuffersNV(n, bufs);
+}
+
+class QOpenGLExtension_NV_fencePrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP DeleteFencesNV)(GLsizei n, const GLuint *fences);
+ void (QOPENGLF_APIENTRYP GenFencesNV)(GLsizei n, GLuint *fences);
+ GLboolean (QOPENGLF_APIENTRYP IsFenceNV)(GLuint fence);
+ GLboolean (QOPENGLF_APIENTRYP TestFenceNV)(GLuint fence);
+ void (QOPENGLF_APIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP FinishFenceNV)(GLuint fence);
+ void (QOPENGLF_APIENTRYP SetFenceNV)(GLuint fence, GLenum condition);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_NV_fence : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_NV_fence();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glDeleteFencesNV(GLsizei n, const GLuint *fences);
+ void glGenFencesNV(GLsizei n, GLuint *fences);
+ GLboolean glIsFenceNV(GLuint fence);
+ GLboolean glTestFenceNV(GLuint fence);
+ void glGetFenceivNV(GLuint fence, GLenum pname, GLint *params);
+ void glFinishFenceNV(GLuint fence);
+ void glSetFenceNV(GLuint fence, GLenum condition);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_NV_fence)
+};
+
+inline void QOpenGLExtension_NV_fence::glDeleteFencesNV(GLsizei n, const GLuint *fences)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ d->DeleteFencesNV(n, fences);
+}
+
+inline void QOpenGLExtension_NV_fence::glGenFencesNV(GLsizei n, GLuint *fences)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ d->GenFencesNV(n, fences);
+}
+
+inline GLboolean QOpenGLExtension_NV_fence::glIsFenceNV(GLuint fence)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ return d->IsFenceNV(fence);
+}
+
+inline GLboolean QOpenGLExtension_NV_fence::glTestFenceNV(GLuint fence)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ return d->TestFenceNV(fence);
+}
+
+inline void QOpenGLExtension_NV_fence::glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ d->GetFenceivNV(fence, pname, params);
+}
+
+inline void QOpenGLExtension_NV_fence::glFinishFenceNV(GLuint fence)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ d->FinishFenceNV(fence);
+}
+
+inline void QOpenGLExtension_NV_fence::glSetFenceNV(GLuint fence, GLenum condition)
+{
+ Q_D(QOpenGLExtension_NV_fence);
+ d->SetFenceNV(fence, condition);
+}
+
+class QOpenGLExtension_NV_read_bufferPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP ReadBufferNV)(GLenum mode);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_NV_read_buffer : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_NV_read_buffer();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glReadBufferNV(GLenum mode);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_NV_read_buffer)
+};
+
+inline void QOpenGLExtension_NV_read_buffer::glReadBufferNV(GLenum mode)
+{
+ Q_D(QOpenGLExtension_NV_read_buffer);
+ d->ReadBufferNV(mode);
+}
+
+class QOpenGLExtension_QCOM_alpha_testPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP AlphaFuncQCOM)(GLenum func, GLclampf ref);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_QCOM_alpha_test : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_QCOM_alpha_test();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glAlphaFuncQCOM(GLenum func, GLclampf ref);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_QCOM_alpha_test)
+};
+
+inline void QOpenGLExtension_QCOM_alpha_test::glAlphaFuncQCOM(GLenum func, GLclampf ref)
+{
+ Q_D(QOpenGLExtension_QCOM_alpha_test);
+ d->AlphaFuncQCOM(func, ref);
+}
+
+class QOpenGLExtension_QCOM_driver_controlPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP GetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls);
+ void (QOPENGLF_APIENTRYP GetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+ void (QOPENGLF_APIENTRYP EnableDriverControlQCOM)(GLuint driverControl);
+ void (QOPENGLF_APIENTRYP DisableDriverControlQCOM)(GLuint driverControl);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_QCOM_driver_control : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_QCOM_driver_control();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls);
+ void glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+ void glEnableDriverControlQCOM(GLuint driverControl);
+ void glDisableDriverControlQCOM(GLuint driverControl);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_QCOM_driver_control)
+};
+
+inline void QOpenGLExtension_QCOM_driver_control::glGetDriverControlsQCOM(GLint *num, GLsizei size, GLuint *driverControls)
+{
+ Q_D(QOpenGLExtension_QCOM_driver_control);
+ d->GetDriverControlsQCOM(num, size, driverControls);
+}
+
+inline void QOpenGLExtension_QCOM_driver_control::glGetDriverControlStringQCOM(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString)
+{
+ Q_D(QOpenGLExtension_QCOM_driver_control);
+ d->GetDriverControlStringQCOM(driverControl, bufSize, length, driverControlString);
+}
+
+inline void QOpenGLExtension_QCOM_driver_control::glEnableDriverControlQCOM(GLuint driverControl)
+{
+ Q_D(QOpenGLExtension_QCOM_driver_control);
+ d->EnableDriverControlQCOM(driverControl);
+}
+
+inline void QOpenGLExtension_QCOM_driver_control::glDisableDriverControlQCOM(GLuint driverControl)
+{
+ Q_D(QOpenGLExtension_QCOM_driver_control);
+ d->DisableDriverControlQCOM(driverControl);
+}
+
+class QOpenGLExtension_QCOM_extended_getPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP ExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures);
+ void (QOPENGLF_APIENTRYP ExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+ void (QOPENGLF_APIENTRYP ExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+ void (QOPENGLF_APIENTRYP ExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+ void (QOPENGLF_APIENTRYP ExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+ void (QOPENGLF_APIENTRYP ExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param);
+ void (QOPENGLF_APIENTRYP ExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+ void (QOPENGLF_APIENTRYP ExtGetBufferPointervQCOM)(GLenum target, GLvoid **params);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_QCOM_extended_get : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_QCOM_extended_get();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures);
+ void glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+ void glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+ void glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+ void glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+ void glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param);
+ void glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
+ void glExtGetBufferPointervQCOM(GLenum target, GLvoid **params);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_QCOM_extended_get)
+};
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetTexturesQCOM(GLuint *textures, GLint maxTextures, GLint *numTextures)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetTexturesQCOM(textures, maxTextures, numTextures);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetBuffersQCOM(GLuint *buffers, GLint maxBuffers, GLint *numBuffers)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetBuffersQCOM(buffers, maxBuffers, numBuffers);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetRenderbuffersQCOM(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetRenderbuffersQCOM(renderbuffers, maxRenderbuffers, numRenderbuffers);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetFramebuffersQCOM(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetFramebuffersQCOM(framebuffers, maxFramebuffers, numFramebuffers);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetTexLevelParameterivQCOM(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetTexLevelParameterivQCOM(texture, face, level, pname, params);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtTexObjectStateOverrideiQCOM(GLenum target, GLenum pname, GLint param)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtTexObjectStateOverrideiQCOM(target, pname, param);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetTexSubImageQCOM(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetTexSubImageQCOM(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get::glExtGetBufferPointervQCOM(GLenum target, GLvoid **params)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get);
+ d->ExtGetBufferPointervQCOM(target, params);
+}
+
+class QOpenGLExtension_QCOM_extended_get2Private : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP ExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders);
+ void (QOPENGLF_APIENTRYP ExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+ GLboolean (QOPENGLF_APIENTRYP ExtIsProgramBinaryQCOM)(GLuint program);
+ void (QOPENGLF_APIENTRYP ExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_QCOM_extended_get2 : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_QCOM_extended_get2();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders);
+ void glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+ GLboolean glExtIsProgramBinaryQCOM(GLuint program);
+ void glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_QCOM_extended_get2)
+};
+
+inline void QOpenGLExtension_QCOM_extended_get2::glExtGetShadersQCOM(GLuint *shaders, GLint maxShaders, GLint *numShaders)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get2);
+ d->ExtGetShadersQCOM(shaders, maxShaders, numShaders);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get2::glExtGetProgramsQCOM(GLuint *programs, GLint maxPrograms, GLint *numPrograms)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get2);
+ d->ExtGetProgramsQCOM(programs, maxPrograms, numPrograms);
+}
+
+inline GLboolean QOpenGLExtension_QCOM_extended_get2::glExtIsProgramBinaryQCOM(GLuint program)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get2);
+ return d->ExtIsProgramBinaryQCOM(program);
+}
+
+inline void QOpenGLExtension_QCOM_extended_get2::glExtGetProgramBinarySourceQCOM(GLuint program, GLenum shadertype, GLchar *source, GLint *length)
+{
+ Q_D(QOpenGLExtension_QCOM_extended_get2);
+ d->ExtGetProgramBinarySourceQCOM(program, shadertype, source, length);
+}
+
+class QOpenGLExtension_QCOM_tiled_renderingPrivate : public QAbstractOpenGLExtensionPrivate
+{
+public:
+ void (QOPENGLF_APIENTRYP StartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+ void (QOPENGLF_APIENTRYP EndTilingQCOM)(GLbitfield preserveMask);
+};
+
+class Q_GUI_EXPORT QOpenGLExtension_QCOM_tiled_rendering : public QAbstractOpenGLExtension
+{
+public:
+ QOpenGLExtension_QCOM_tiled_rendering();
+
+ bool initializeOpenGLFunctions() Q_DECL_FINAL;
+
+ void glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+ void glEndTilingQCOM(GLbitfield preserveMask);
+
+protected:
+ Q_DECLARE_PRIVATE(QOpenGLExtension_QCOM_tiled_rendering)
+};
+
+inline void QOpenGLExtension_QCOM_tiled_rendering::glStartTilingQCOM(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask)
+{
+ Q_D(QOpenGLExtension_QCOM_tiled_rendering);
+ d->StartTilingQCOM(x, y, width, height, preserveMask);
+}
+
+inline void QOpenGLExtension_QCOM_tiled_rendering::glEndTilingQCOM(GLbitfield preserveMask)
+{
+ Q_D(QOpenGLExtension_QCOM_tiled_rendering);
+ d->EndTilingQCOM(preserveMask);
+}
+
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_OPENGL
+
+#endif
diff --git a/util/glgen/qopenglextensions.h.header b/util/glgen/qopenglextensions.h.header
new file mode 100644
index 0000000000..89e248fc33
--- /dev/null
+++ b/util/glgen/qopenglextensions.h.header
@@ -0,0 +1,208 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#ifndef QOPENGLEXTENSIONS_H
+#define QOPENGLEXTENSIONS_H
+
+#ifndef QT_NO_OPENGL
+
+#include <QtCore/QtGlobal>
+#include <QtGui/qopengl.h>
+
+class QOpenGLContext;
+
+QT_BEGIN_NAMESPACE
+
+#if 0
+// silence syncqt warnings
+#pragma qt_class(QOpenGLExtensions)
+#pragma qt_sync_stop_processing
+#endif
+
+#if !defined(QT_OPENGL_ES_2)
+// This block is copied from glext.h and defines the types needed by
+// a few extension classes. This may need updating in glgen when a new
+// OpenGL release is made and this file is regenerated.
+
+#include <stddef.h>
+#ifndef GL_VERSION_2_0
+/* GL type for program/shader text */
+typedef char GLchar;
+#endif
+
+#ifndef GL_VERSION_1_5
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptr;
+typedef ptrdiff_t GLsizeiptr;
+#endif
+
+#ifndef GL_ARB_vertex_buffer_object
+/* GL types for handling large vertex buffer objects */
+typedef ptrdiff_t GLintptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
+#ifndef GL_ARB_shader_objects
+/* GL types for program/shader text and shader object handles */
+typedef char GLcharARB;
+typedef unsigned int GLhandleARB;
+#endif
+
+/* GL type for "half" precision (s10e5) float data in host memory */
+#ifndef GL_ARB_half_float_pixel
+typedef unsigned short GLhalfARB;
+#endif
+
+#ifndef GL_NV_half_float
+typedef unsigned short GLhalfNV;
+#endif
+
+#ifndef GLEXT_64_TYPES_DEFINED
+/* This code block is duplicated in glxext.h, so must be protected */
+#define GLEXT_64_TYPES_DEFINED
+/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
+/* (as used in the GL_EXT_timer_query extension). */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+#elif defined(__sun__) || defined(__digital__)
+#include <inttypes.h>
+#if defined(__STDC__)
+#if defined(__arch64__) || defined(_LP64)
+typedef long int int64_t;
+typedef unsigned long int uint64_t;
+#else
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#endif /* __arch64__ */
+#endif /* __STDC__ */
+#elif defined( __VMS ) || defined(__sgi)
+#include <inttypes.h>
+#elif defined(__SCO__) || defined(__USLC__)
+#include <stdint.h>
+#elif defined(__UNIXOS2__) || defined(__SOL64__)
+typedef long int int32_t;
+typedef long long int int64_t;
+typedef unsigned long long int uint64_t;
+#elif defined(_WIN32) && defined(__GNUC__)
+#include <stdint.h>
+#elif defined(_WIN32)
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#else
+/* Fallback if nothing above works */
+#include <inttypes.h>
+#endif
+#endif
+
+#ifndef GL_EXT_timer_query
+typedef int64_t GLint64EXT;
+typedef uint64_t GLuint64EXT;
+#endif
+
+#ifndef GL_ARB_sync
+typedef int64_t GLint64;
+typedef uint64_t GLuint64;
+typedef struct __GLsync *GLsync;
+#endif
+
+#ifndef GL_ARB_cl_event
+/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */
+struct _cl_context;
+struct _cl_event;
+#endif
+
+#ifndef GL_ARB_debug_output
+typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_AMD_debug_output
+typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_KHR_debug
+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
+#endif
+
+#ifndef GL_NV_vdpau_interop
+typedef GLintptr GLvdpauSurfaceNV;
+#endif
+
+// End of block copied from glext.h
+#endif
+
+struct QOpenGLFunctionsPrivate;
+
+class QAbstractOpenGLExtensionPrivate
+{
+public:
+ QAbstractOpenGLExtensionPrivate() : initialized(false) {}
+ bool initialized;
+};
+
+class QAbstractOpenGLExtension
+{
+public:
+ virtual ~QAbstractOpenGLExtension();
+
+ virtual bool initializeOpenGLFunctions();
+
+ Q_DECLARE_PRIVATE(QAbstractOpenGLExtension)
+
+protected:
+ bool isInitialized() const;
+
+ QAbstractOpenGLExtension() {}
+ QAbstractOpenGLExtension(QAbstractOpenGLExtensionPrivate &dd) : d_ptr(&dd) {}
+ QAbstractOpenGLExtensionPrivate *d_ptr;
+};
+
+#if !defined(QT_OPENGL_ES_2)
+
diff --git a/util/glgen/qopenglversionfunctions.cpp.footer b/util/glgen/qopenglversionfunctions.cpp.footer
new file mode 100644
index 0000000000..f003b56097
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions.cpp.footer
@@ -0,0 +1,8 @@
+
+#else
+
+// No backends for OpenGL ES 2
+
+#endif // !QT_OPENGL_ES_2
+
+QT_END_NAMESPACE
diff --git a/util/glgen/qopenglversionfunctions.cpp.header b/util/glgen/qopenglversionfunctions.cpp.header
new file mode 100644
index 0000000000..316b79011d
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions.cpp.header
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#include "qopenglversionfunctions.h"
+#include "qopenglcontext.h"
+#include "qdebug.h"
+
+QT_BEGIN_NAMESPACE
+
+QOpenGLVersionFunctionsBackend *QAbstractOpenGLFunctionsPrivate::functionsBackend(QOpenGLContext *context,
+ const QOpenGLVersionStatus &v)
+{
+ Q_ASSERT(context);
+ return context->functionsBackend(v);
+}
+
+void QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(QOpenGLContext *context,
+ const QOpenGLVersionStatus &v,
+ QOpenGLVersionFunctionsBackend *backend)
+{
+ Q_ASSERT(context);
+ context->insertFunctionsBackend(v, backend);
+}
+
+void QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(QOpenGLContext *context, const QOpenGLVersionStatus &v)
+{
+ Q_ASSERT(context);
+ context->removeFunctionsBackend(v);
+}
+
+
+/*!
+ \class QAbstractOpenGLFunctions
+ \inmodule QtGui
+ \since 5.1
+ \brief The QAbstractOpenGLFunctions class is the base class of a family of
+ classes that expose all functions for each OpenGL version and
+ profile.
+
+ OpenGL implementations on different platforms are able to link to a variable
+ number of OpenGL functions depending upon the OpenGL ABI on that platform.
+ For example, on Microsoft Windows only functions up to those in OpenGL 1.1
+ can be linked to at build time. All other functions must be resolved at
+ runtime. The traditional solution to this has been to use either
+ QOpenGLContext::getProcAddress() or QOpenGLFunctions. The former is tedious
+ and error prone and means dealing directly with function pointers. The
+ latter only exposes those functions common to OpenGL ES 2 and desktop
+ OpenGL. There is however much new OpenGL functionality that is useful when
+ writing real world OpenGL applications.
+
+ Qt now provides a family of classes which all inherit from
+ QAbstractOpenGLFunctions which expose every core OpenGL function by way of a
+ corresponding member function. There is a class for every valid combination
+ of OpenGL version and profile. Each class follows the naming convention
+ QOpenGLFunctions_<MAJOR VERSION>_<MINOR VERSION>[_PROFILE].
+
+ For OpenGL versions 1.0 through to 3.0 there are no profiles, leading to the
+ classes:
+
+ \list
+ \li QOpenGLFunctions_1_0
+ \li QOpenGLFunctions_1_1
+ \li QOpenGLFunctions_1_2
+ \li QOpenGLFunctions_1_3
+ \li QOpenGLFunctions_1_4
+ \li QOpenGLFunctions_1_5
+ \li QOpenGLFunctions_2_0
+ \li QOpenGLFunctions_2_1
+ \li QOpenGLFunctions_3_0
+ \endlist
+
+ where each class inherits from QAbstractOpenGLFunctions.
+
+ OpenGL version 3.1 removed many deprecated functions leading to a much
+ simpler and generic API.
+
+ With OpenGL 3.2 the concept of profiles was introduced. Two profiles are
+ currently defined for OpenGL: Core and Compatibility.
+
+ The Core profile does not include any of the functions that were removed
+ in OpenGL 3.1. The Compatibility profile contains all functions in the
+ Core profile of the same version plus all of the functions that were
+ removed in OpenGL 3.1. In this way the Compatibility profile classes allow
+ use of newer OpenGL functionality but also allows you to keep using your
+ legacy OpenGL code. For new OpenGL code the Core profile should be
+ preferred.
+
+ Please note that some vendors, notably Apple, do not implement the
+ Compatibility profile. Therefore if you wish to target new OpenGL features
+ on OS X then you should ensure that you request a Core profile context via
+ QSurfaceFormat::setProfile().
+
+ Qt provides classes for all version and Core and Compatibility profile
+ combinations. The classes for OpenGL versions 3.1 through to 4.3 are:
+
+ \list
+ \li QOpenGLFunctions_3_1
+ \li QOpenGLFunctions_3_2_Core
+ \li QOpenGLFunctions_3_2_Compatibility
+ \li QOpenGLFunctions_3_3_Core
+ \li QOpenGLFunctions_3_3_Compatibility
+ \li QOpenGLFunctions_4_0_Core
+ \li QOpenGLFunctions_4_0_Compatibility
+ \li QOpenGLFunctions_4_1_Core
+ \li QOpenGLFunctions_4_1_Compatibility
+ \li QOpenGLFunctions_4_2_Core
+ \li QOpenGLFunctions_4_2_Compatibility
+ \li QOpenGLFunctions_4_3_Core
+ \li QOpenGLFunctions_4_3_Compatibility
+ \endlist
+
+ where each class inherits from QAbstractOpenGLFunctions.
+
+ A pointer to an object of the class corresponding to the version and
+ profile of OpenGL in use can be obtained from
+ QOpenGLFunctions::versionFunctions(). If obtained in this way, note that
+ the QOpenGLContext retains ownership of the object. This is so that only
+ one instance need be created.
+
+ Before calling any of the exposed OpenGL functions you must ensure that the
+ object has resolved the function pointers to the OpenGL functions. This
+ only needs to be done once per instance with initializeOpenGLFunctions().
+ Once initialized, the object can be used to call any OpenGL function for
+ the corresponding version and profile. Note that initializeOpenGLFunctions()
+ can fail in some circumstances so check the return value. Situations in
+ which initialization can fail are if you have a functions object for a version
+ or profile that contains functions that are not part of the context being
+ used to resolve the function pointers.
+
+ If you exclusively use function objects then you will get compile time
+ errors if you attempt to use a function not included in that version and
+ profile. This is obviously a lot easier to debug than undefined behavior
+ at run time.
+
+ \sa QOpenGLContext::versionFunctions()
+*/
+QAbstractOpenGLFunctions::QAbstractOpenGLFunctions()
+ : d_ptr(new QAbstractOpenGLFunctionsPrivate)
+{
+}
+
+QAbstractOpenGLFunctions::~QAbstractOpenGLFunctions()
+{
+ delete d_ptr;
+}
+
+bool QAbstractOpenGLFunctions::initializeOpenGLFunctions()
+{
+ Q_D(QAbstractOpenGLFunctions);
+ d->initialized = true;
+ return true;
+}
+
+bool QAbstractOpenGLFunctions::isInitialized() const
+{
+ Q_D(const QAbstractOpenGLFunctions);
+ return d->initialized;
+}
+
+void QAbstractOpenGLFunctions::setOwningContext(const QOpenGLContext *context)
+{
+ Q_D(QAbstractOpenGLFunctions);
+ d->owningContext = const_cast<QOpenGLContext*>(context);
+}
+
+QOpenGLContext *QAbstractOpenGLFunctions::owningContext() const
+{
+ Q_D(const QAbstractOpenGLFunctions);
+ return d->owningContext;
+}
+
+#if !defined(QT_OPENGL_ES_2)
+
diff --git a/util/glgen/qopenglversionfunctions.h.footer b/util/glgen/qopenglversionfunctions.h.footer
new file mode 100644
index 0000000000..dc29c75177
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions.h.footer
@@ -0,0 +1,13 @@
+
+#else
+
+// No need for backend classes with function pointers with ES2.
+// All function addresses are independent of context and display.
+
+#endif // !QT_OPENGL_ES_2
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_OPENGL
+
+#endif
diff --git a/util/glgen/qopenglversionfunctions.h.header b/util/glgen/qopenglversionfunctions.h.header
new file mode 100644
index 0000000000..3bd28fc52d
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions.h.header
@@ -0,0 +1,163 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#ifndef QOPENGLVERSIONFUNCTIONS_H
+#define QOPENGLVERSIONFUNCTIONS_H
+
+#ifndef QT_NO_OPENGL
+
+#include <QtCore/QtGlobal>
+#include <QtCore/qhash.h>
+#include <QtCore/qpair.h>
+#include <QtGui/qopengl.h>
+
+class QOpenGLContext;
+
+QT_BEGIN_NAMESPACE
+
+#if 0
+// silence syncqt warnings
+#pragma qt_class(QOpenGLVersionFunctions)
+#pragma qt_sync_stop_processing
+#endif
+
+struct QOpenGLVersionStatus
+{
+ enum OpenGLStatus {
+ CoreStatus,
+ DeprecatedStatus,
+ InvalidStatus
+ };
+
+ QOpenGLVersionStatus()
+ : version(qMakePair(0, 0)),
+ status(InvalidStatus)
+ {}
+
+ QOpenGLVersionStatus(int majorVersion, int minorVersion, QOpenGLVersionStatus::OpenGLStatus functionStatus)
+ : version(qMakePair(majorVersion, minorVersion)),
+ status(functionStatus)
+ {}
+
+ QPair<int, int> version;
+ OpenGLStatus status;
+};
+
+inline uint qHash(const QOpenGLVersionStatus &v, uint seed)
+{
+ return qHash(static_cast<int>(v.status * 1000)
+ + v.version.first * 100 + v.version.second * 10, seed);
+}
+
+inline bool operator==(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
+{
+ if (lhs.status != rhs.status)
+ return false;
+ return lhs.version == rhs.version;
+}
+
+inline bool operator!=(const QOpenGLVersionStatus &lhs, const QOpenGLVersionStatus &rhs)
+{
+ return !operator==(lhs, rhs);
+}
+
+class QOpenGLVersionFunctionsBackend
+{
+public:
+ QOpenGLVersionFunctionsBackend(QOpenGLContext *ctx)
+ : context(ctx)
+ {}
+
+ QOpenGLContext *context;
+ QAtomicInt refs;
+};
+
+class QAbstractOpenGLFunctionsPrivate
+{
+public:
+ QAbstractOpenGLFunctionsPrivate()
+ : owningContext(0),
+ initialized(false)
+ {}
+
+ static QOpenGLVersionFunctionsBackend *functionsBackend(QOpenGLContext *context,
+ const QOpenGLVersionStatus &v);
+ static void insertFunctionsBackend(QOpenGLContext *context,
+ const QOpenGLVersionStatus &v,
+ QOpenGLVersionFunctionsBackend *backend);
+ static void removeFunctionsBackend(QOpenGLContext *context, const QOpenGLVersionStatus &v);
+
+ QOpenGLContext *owningContext;
+ bool initialized;
+};
+
+class QAbstractOpenGLFunctions
+{
+public:
+ virtual ~QAbstractOpenGLFunctions();
+
+ virtual bool initializeOpenGLFunctions();
+
+ Q_DECLARE_PRIVATE(QAbstractOpenGLFunctions)
+
+protected:
+ QAbstractOpenGLFunctions();
+ QAbstractOpenGLFunctionsPrivate *d_ptr;
+
+ bool isInitialized() const;
+
+ void setOwningContext(const QOpenGLContext *context);
+ QOpenGLContext *owningContext() const;
+
+ friend class QOpenGLContext;
+};
+
+#if !defined(QT_OPENGL_ES_2)
+
diff --git a/util/glgen/qopenglversionfunctions__VERSION__.cpp.footer b/util/glgen/qopenglversionfunctions__VERSION__.cpp.footer
new file mode 100644
index 0000000000..b81ea7b6ea
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions__VERSION__.cpp.footer
@@ -0,0 +1,2 @@
+
+QT_END_NAMESPACE
diff --git a/util/glgen/qopenglversionfunctions__VERSION__.cpp.header b/util/glgen/qopenglversionfunctions__VERSION__.cpp.header
new file mode 100644
index 0000000000..f92c0dd3fd
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions__VERSION__.cpp.header
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#include "qopenglfunctions__VERSION__.h"
+#include "qopenglcontext.h"
+
+QT_BEGIN_NAMESPACE
+
diff --git a/util/glgen/qopenglversionfunctions__VERSION__.h.footer b/util/glgen/qopenglversionfunctions__VERSION__.h.footer
new file mode 100644
index 0000000000..02db4d3a13
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions__VERSION__.h.footer
@@ -0,0 +1,6 @@
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_OPENGL
+
+#endif
diff --git a/util/glgen/qopenglversionfunctions__VERSION__.h.header b/util/glgen/qopenglversionfunctions__VERSION__.h.header
new file mode 100644
index 0000000000..b3d097c2f9
--- /dev/null
+++ b/util/glgen/qopenglversionfunctions__VERSION__.h.header
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#ifndef QOPENGLVERSIONFUNCTIONS__VERSION___H
+#define QOPENGLVERSIONFUNCTIONS__VERSION___H
+
+#ifndef QT_NO_OPENGL
+
+#include <QtGui/QOpenGLVersionFunctions>
+#include <QtGui/qopenglcontext.h>
+
+QT_BEGIN_NAMESPACE
+
diff --git a/util/glgen/qopenglversionfunctionsfactory.cpp.footer b/util/glgen/qopenglversionfunctionsfactory.cpp.footer
new file mode 100644
index 0000000000..b81ea7b6ea
--- /dev/null
+++ b/util/glgen/qopenglversionfunctionsfactory.cpp.footer
@@ -0,0 +1,2 @@
+
+QT_END_NAMESPACE
diff --git a/util/glgen/qopenglversionfunctionsfactory.cpp.header b/util/glgen/qopenglversionfunctionsfactory.cpp.header
new file mode 100644
index 0000000000..6be93102dc
--- /dev/null
+++ b/util/glgen/qopenglversionfunctionsfactory.cpp.header
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#include "qopenglversionfunctionsfactory_p.h"
+
diff --git a/util/glgen/qopenglversionfunctionsfactory_p.h.header b/util/glgen/qopenglversionfunctionsfactory_p.h.header
new file mode 100644
index 0000000000..2312e900f9
--- /dev/null
+++ b/util/glgen/qopenglversionfunctionsfactory_p.h.header
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module 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$
+**
+**
+** This file was generated by glgen version 0.1
+** Command line was: glgen
+**
+** glgen is Copyright (C) 2012 Klaralvdalens Datakonsult AB (KDAB)
+**
+** This is an auto-generated file.
+** Do not edit! All changes made to it will be lost.
+**
+****************************************************************************/
+
+#ifndef QOPENGLVERSIONFUNCTIONFACTORY_P_H
+#define QOPENGLVERSIONFUNCTIONFACTORY_P_H
+
+#ifndef QT_NO_OPENGL
+
+#include <QtCore/QtGlobal>
+#include <QtGui/qopenglcontext.h>
+
+QT_BEGIN_NAMESPACE
+
+class QAbstractOpenGLFunctions;
+
+class QOpenGLVersionFunctionsFactory
+{
+public:
+ static QAbstractOpenGLFunctions *create(const QOpenGLVersionProfile &versionProfile);
+};
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_OPENGL
+
+#endif
diff --git a/util/glgen/specparser.cpp b/util/glgen/specparser.cpp
new file mode 100644
index 0000000000..514a700644
--- /dev/null
+++ b/util/glgen/specparser.cpp
@@ -0,0 +1,307 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the utilities 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 "specparser.h"
+
+#include <QDebug>
+#include <QFile>
+#include <QRegExp>
+#include <QStringList>
+#include <QTextStream>
+
+#ifdef SPECPARSER_DEBUG
+#define qSpecParserDebug qDebug
+#else
+#define qSpecParserDebug QT_NO_QDEBUG_MACRO
+#endif
+
+SpecParser::SpecParser()
+{
+}
+
+void SpecParser::parse()
+{
+ // Get the mapping form generic types to specific types suitable for use in C-headers
+ if (!parseTypeMap())
+ return;
+
+ // Open up a stream on the actual OpenGL function spec file
+ QFile file(m_specFileName);
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qWarning() << "Failed to open spec file:" << m_specFileName << "Aborting";
+ return;
+ }
+
+ QTextStream stream(&file);
+
+ // Extract the info that we need
+ parseFunctions(stream);
+}
+
+bool SpecParser::parseTypeMap()
+{
+ QFile file(m_typeMapFileName);
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ qWarning() << "Failed to open spec file:" << m_specFileName << "Aborting";
+ return false;
+ }
+
+ QTextStream stream(&file);
+
+ static QRegExp typeMapRegExp("([^,]+)\\W+([^,]+)");
+
+ while (!stream.atEnd()) {
+ QString line = stream.readLine();
+
+ if (line.startsWith(QStringLiteral("#")))
+ continue;
+
+ if (typeMapRegExp.indexIn(line) != -1) {
+ QString key = typeMapRegExp.cap(1).simplified();
+ QString value = typeMapRegExp.cap(2).simplified();
+
+ // Special case for void
+ if (value == QStringLiteral("*"))
+ value = QStringLiteral("void");
+
+ m_typeMap.insert(key, value);
+ qSpecParserDebug() << "Found type mapping from" << key << "=>" << value;
+ }
+ }
+
+ return true;
+}
+
+void SpecParser::parseEnums()
+{
+}
+
+void SpecParser::parseFunctions(QTextStream &stream)
+{
+ static QRegExp functionRegExp("^(\\w+)\\(.*\\)");
+ static QRegExp returnRegExp("^\\treturn\\s+(\\S+)");
+ static QRegExp argumentRegExp("param\\s+(\\S+)\\s+(\\S+) (\\S+) (\\S+)");
+ static QRegExp versionRegExp("^\\tversion\\s+(\\S+)");
+ static QRegExp deprecatedRegExp("^\\tdeprecated\\s+(\\S+)");
+ static QRegExp categoryRegExp("^\\tcategory\\s+(\\S+)");
+ static QRegExp categoryVersionRegExp("VERSION_(\\d)_(\\d)");
+ static QRegExp extToCoreVersionRegExp("passthru:\\s/\\*\\sOpenGL\\s(\\d)\\.(\\d)\\s.*\\sextensions:");
+ static QRegExp extToCoreRegExp("passthru:\\s/\\*\\s(ARB_\\S*)\\s.*\\*/");
+
+ Function currentFunction;
+ VersionProfile currentVersionProfile;
+ QString currentCategory;
+ bool haveVersionInfo = false;
+ bool acceptCurrentFunctionInCore = false;
+ bool acceptCurrentFunctionInExtension = false;
+
+ QHash<QString, Version> extensionsNowInCore;
+ Version extToCoreCurrentVersion;
+ int functionCount = 0;
+
+ QSet<Version> versions;
+
+ while (!stream.atEnd()) {
+ QString line = stream.readLine();
+ if (line.startsWith("#"))
+ continue;
+
+ if (functionRegExp.indexIn(line) != -1) {
+
+ if (!currentFunction.name.isEmpty()) {
+
+ // NB - Special handling!
+ // Versions 4.2 and 4.3 (and probably newer) add functionality by
+ // subsuming extensions such as ARB_texture_storage. However, some extensions
+ // also include functions to interact with the EXT_direct_state_access
+ // extension. These functions should be added to the DSA extension rather
+ // than the core functionality. The core will already contain non-DSA
+ // versions of these functions.
+ if (acceptCurrentFunctionInCore && currentFunction.name.endsWith(QStringLiteral("EXT"))) {
+ acceptCurrentFunctionInCore = false;
+ acceptCurrentFunctionInExtension = true;
+ currentCategory = QStringLiteral("EXT_direct_state_access");
+ }
+
+ // Finish off previous function (if any) by inserting it into the core
+ // functionality or extension functionality (or both)
+ if (acceptCurrentFunctionInCore) {
+ m_functions.insert(currentVersionProfile, currentFunction);
+ versions.insert(currentVersionProfile.version);
+ }
+
+ if (acceptCurrentFunctionInExtension)
+ m_extensionFunctions.insert(currentCategory, currentFunction);
+ }
+
+ // Start a new function
+ ++functionCount;
+ haveVersionInfo = false;
+ acceptCurrentFunctionInCore = true;
+ acceptCurrentFunctionInExtension = false;
+ currentCategory = QString();
+ currentFunction = Function();
+
+ // We assume a core function unless we find a deprecated flag (see below)
+ currentVersionProfile = VersionProfile();
+ currentVersionProfile.profile = VersionProfile::CoreProfile;
+
+ // Extract the function name
+ QString functionName = functionRegExp.cap(1);
+ currentFunction.name = functionName;
+ qSpecParserDebug() << "Found function:" << functionName;
+
+ } else if (argumentRegExp.indexIn(line) != -1) {
+ // Extract info about this function argument
+ Argument arg;
+ arg.name = argumentRegExp.cap(1);
+
+ QString type = argumentRegExp.cap(2); // Lookup in type map
+ arg.type = m_typeMap.value(type);
+
+ QString direction = argumentRegExp.cap(3);
+ if (direction == QStringLiteral("in")) {
+ arg.direction = Argument::In;
+ } else if (direction == QStringLiteral("out")) {
+ arg.direction = Argument::Out;
+ } else {
+ qWarning() << "Invalid argument direction found:" << direction;
+ acceptCurrentFunctionInCore = false;
+ }
+
+ QString mode = argumentRegExp.cap(4);
+ if (mode == QStringLiteral("value")) {
+ arg.mode = Argument::Value;
+ } else if (mode == QStringLiteral("array")) {
+ arg.mode = Argument::Array;
+ } else if (mode == QStringLiteral("reference")) {
+ arg.mode = Argument::Reference;
+ } else {
+ qWarning() << "Invalid argument mode found:" << mode;
+ acceptCurrentFunctionInCore = false;
+ }
+
+ qSpecParserDebug() << " argument:" << arg.type << arg.name;
+ currentFunction.arguments.append(arg);
+
+ } else if (returnRegExp.indexIn(line) != -1) {
+ // Lookup the return type from the typemap
+ QString returnTypeKey = returnRegExp.cap(1).simplified();
+ if (!m_typeMap.contains(returnTypeKey)) {
+ qWarning() << "Unknown return type found:" << returnTypeKey;
+ acceptCurrentFunctionInCore = false;
+ }
+ QString returnType = m_typeMap.value(returnTypeKey);
+ qSpecParserDebug() << " return type:" << returnType;
+ currentFunction.returnType = returnType;
+
+ } else if (versionRegExp.indexIn(line) != -1 && !haveVersionInfo) { // Only use version line if no other source
+ // Extract the OpenGL version in which this function was introduced
+ QString version = versionRegExp.cap(1);
+ qSpecParserDebug() << " version:" << version;
+ QStringList parts = version.split(QLatin1Char('.'));
+ if (parts.size() != 2) {
+ qWarning() << "Found invalid version number";
+ continue;
+ }
+ int majorVersion = parts.first().toInt();
+ int minorVersion = parts.last().toInt();
+ Version v;
+ v.major = majorVersion;
+ v.minor = minorVersion;
+ currentVersionProfile.version = v;
+
+ } else if (deprecatedRegExp.indexIn(line) != -1) {
+ // Extract the OpenGL version in which this function was deprecated.
+ // If it is OpenGL 3.1 then it must be a compatibility profile function
+ QString deprecatedVersion = deprecatedRegExp.cap(1).simplified();
+ if (deprecatedVersion == QStringLiteral("3.1"))
+ currentVersionProfile.profile = VersionProfile::CompatibilityProfile;
+
+ } else if (categoryRegExp.indexIn(line) != -1) {
+ // Extract the category for this function
+ QString category = categoryRegExp.cap(1).simplified();
+ qSpecParserDebug() << " category:" << category;
+
+ if (categoryVersionRegExp.indexIn(category) != -1) {
+ // Use the version info in the category in preference to the version
+ // entry as this is more applicable and consistent
+ int majorVersion = categoryVersionRegExp.cap(1).toInt();
+ int minorVersion = categoryVersionRegExp.cap(2).toInt();
+
+ Version v;
+ v.major = majorVersion;
+ v.minor = minorVersion;
+ currentVersionProfile.version = v;
+ haveVersionInfo = true;
+
+ } else {
+ // Make a note of the extension name and tag this function as being part of an extension
+ qSpecParserDebug() << "Found category =" << category;
+ currentCategory = category;
+ acceptCurrentFunctionInExtension = true;
+
+ // See if this category (extension) is in our set of extensions that
+ // have now been folded into the core feature set
+ if (extensionsNowInCore.contains(category)) {
+ currentVersionProfile.version = extensionsNowInCore.value(category);
+ haveVersionInfo = true;
+ } else {
+ acceptCurrentFunctionInCore = false;
+ }
+ }
+
+ } else if (extToCoreVersionRegExp.indexIn(line) != -1) {
+ qSpecParserDebug() << line;
+ int majorVersion = extToCoreVersionRegExp.cap(1).toInt();
+ int minorVersion = extToCoreVersionRegExp.cap(2).toInt();
+ extToCoreCurrentVersion.major = majorVersion;
+ extToCoreCurrentVersion.minor = minorVersion;
+
+ } else if (extToCoreRegExp.indexIn(line) != -1) {
+ QString extension = extToCoreRegExp.cap(1);
+ extensionsNowInCore.insert(extension, extToCoreCurrentVersion);
+ }
+ }
+
+ m_versions = versions.toList();
+ qSort(m_versions);
+}
diff --git a/util/glgen/specparser.h b/util/glgen/specparser.h
new file mode 100644
index 0000000000..e455f6579c
--- /dev/null
+++ b/util/glgen/specparser.h
@@ -0,0 +1,209 @@
+/***************************************************************************
+**
+** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB)
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the utilities 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$
+**
+****************************************************************************/
+
+#ifndef SPECPARSER_H
+#define SPECPARSER_H
+
+#include <QStringList>
+#include <QVariant>
+
+class QTextStream;
+
+struct Version {
+ int major;
+ int minor;
+};
+
+inline bool operator == (const Version &lhs, const Version &rhs)
+{
+ return (lhs.major == rhs.major && lhs.minor == rhs.minor);
+}
+
+inline bool operator < (const Version &lhs, const Version &rhs)
+{
+ if (lhs.major != rhs.major)
+ return (lhs.major < rhs.major);
+ else
+ return (lhs.minor < rhs.minor);
+}
+
+inline bool operator > (const Version &lhs, const Version &rhs)
+{
+ if (lhs.major != rhs.major)
+ return (lhs.major > rhs.major);
+ else
+ return (lhs.minor > rhs.minor);
+}
+
+inline uint qHash(const Version &v)
+{
+ return qHash(v.major * 100 + v.minor * 10);
+}
+
+struct VersionProfile
+{
+ enum OpenGLProfile {
+ CoreProfile = 0,
+ CompatibilityProfile
+ };
+
+ inline bool hasProfiles() const
+ {
+ return ( version.major > 3
+ || (version.major == 3 && version.minor > 1));
+ }
+
+ Version version;
+ OpenGLProfile profile;
+};
+
+inline bool operator == (const VersionProfile &lhs, const VersionProfile &rhs)
+{
+ if (lhs.profile != rhs.profile)
+ return false;
+ return lhs.version == rhs.version;
+}
+
+inline bool operator < (const VersionProfile &lhs, const VersionProfile &rhs)
+{
+ if (lhs.profile != rhs.profile)
+ return (lhs.profile < rhs.profile);
+ return (lhs.version < rhs.version);
+}
+
+inline uint qHash(const VersionProfile &v)
+{
+ return qHash(static_cast<int>(v.profile * 1000) + v.version.major * 100 + v.version.minor * 10);
+}
+
+struct Argument
+{
+ enum Direction {
+ In = 0,
+ Out
+ };
+
+ enum Mode {
+ Value = 0,
+ Array,
+ Reference
+ };
+
+ QString type;
+ QString name;
+ Direction direction;
+ Mode mode;
+};
+
+struct Function
+{
+ QString returnType;
+ QString name;
+ QList<Argument> arguments;
+};
+
+typedef QList<Function> FunctionList;
+typedef QMap<VersionProfile, FunctionList> FunctionCollection;
+
+class SpecParser
+{
+public:
+ explicit SpecParser();
+
+ QString specFileName() const
+ {
+ return m_specFileName;
+ }
+
+ QString typeMapFileName() const
+ {
+ return m_typeMapFileName;
+ }
+
+ QList<Version> versions() const {return m_versions;}
+ QList<VersionProfile> versionProfiles() const {return m_functions.uniqueKeys();}
+
+ QList<Function> functionsForVersion(const VersionProfile &v) const
+ {
+ return m_functions.values(v);
+ }
+
+ QStringList extensions() const
+ {
+ return QStringList(m_extensionFunctions.uniqueKeys());
+ }
+
+ QList<Function> functionsForExtension(const QString &extension)
+ {
+ return m_extensionFunctions.values(extension);
+ }
+
+ void setSpecFileName(QString arg)
+ {
+ m_specFileName = arg;
+ }
+
+ void setTypeMapFileName(QString arg)
+ {
+ m_typeMapFileName = arg;
+ }
+
+ void parse();
+
+protected:
+ bool parseTypeMap();
+ void parseEnums();
+ void parseFunctions(QTextStream &stream);
+
+private:
+ QString m_specFileName;
+ QString m_typeMapFileName;
+
+ QMap<QString, QString> m_typeMap;
+ QMultiMap<VersionProfile, Function> m_functions;
+
+ QList<Version> m_versions;
+
+ // Extension support
+ QMultiMap<QString, Function> m_extensionFunctions;
+};
+
+#endif // SPECPARSER_H
diff --git a/util/lexgen/generator.cpp b/util/lexgen/generator.cpp
index a6fc93c0ca..06ba586c1f 100644
--- a/util/lexgen/generator.cpp
+++ b/util/lexgen/generator.cpp
@@ -48,7 +48,7 @@ void Function::printDeclaration(CodeBlock &block, const QString &funcNamePrefix)
block << (iline ? "inline " : "") << signature(funcNamePrefix) << (iline ? QLatin1String(" {") : QLatin1String(";"));
if (!iline)
return;
-
+
block.indent();
QString tmp = body;
if (tmp.endsWith(QLatin1Char('\n')))
@@ -81,7 +81,7 @@ QString Function::definition() const
QString result;
result += signature();
result += QLatin1String("\n{\n");
-
+
QString tmp = body;
if (tmp.endsWith(QLatin1Char('\n')))
@@ -92,7 +92,7 @@ QString Function::definition() const
tmp.replace(QLatin1Char('\n'), QLatin1String("\n "));
result += tmp;
-
+
result += QLatin1String("\n}\n");
return result;
@@ -102,16 +102,16 @@ void Class::Section::printDeclaration(const Class *klass, CodeBlock &block) cons
{
foreach (Function ctor, constructors)
ctor.printDeclaration(block, klass->name());
-
+
if (!constructors.isEmpty())
block.addNewLine();
-
+
foreach (Function func, functions)
func.printDeclaration(block);
-
+
if (!functions.isEmpty())
block.addNewLine();
-
+
foreach (QString var, variables)
block << var << ';';
}
@@ -133,13 +133,13 @@ void Class::addConstructor(Access access, const QString &body, const QString &_a
QString Class::Section::definition(const Class *klass) const
{
QString result;
-
+
foreach (Function ctor, constructors) {
ctor.setName(klass->name() + "::" + klass->name() + ctor.name());
result += ctor.definition();
result += QLatin1Char('\n');
}
-
+
foreach (Function func, functions) {
if (!func.hasBody()) continue;
func.setName(klass->name() + "::" + func.name());
@@ -153,10 +153,10 @@ QString Class::Section::definition(const Class *klass) const
QString Class::declaration() const
{
CodeBlock block;
-
+
block << QLatin1String("class ") << cname;
block << "{";
-
+
if (!sections[PublicMember].isEmpty()) {
block << "public:";
block.indent();
@@ -170,7 +170,7 @@ QString Class::declaration() const
sections[ProtectedMember].printDeclaration(this, block);
block.outdent();
}
-
+
if (!sections[PrivateMember].isEmpty()) {
block << "private:";
block.indent();
@@ -180,7 +180,7 @@ QString Class::declaration() const
block << "};";
block.addNewLine();
-
+
return block.toString();
}
@@ -406,12 +406,12 @@ void Generator::generateTransitions(CodeBlock &body, const TransitionMap &transi
QString Generator::generate()
{
Class klass(cfg.className);
-
+
klass.addMember(Class::PublicMember, "QString input");
klass.addMember(Class::PublicMember, "int pos");
klass.addMember(Class::PublicMember, "int lexemStart");
klass.addMember(Class::PublicMember, "int lexemLength");
-
+
{
CodeBlock body;
body << "input = inp;";
@@ -420,7 +420,7 @@ QString Generator::generate()
body << "lexemLength = 0;";
klass.addConstructor(Class::PublicMember, body, "const QString &inp");
}
-
+
{
Function next("QChar", "next()");
next.setInline(true);
@@ -430,7 +430,7 @@ QString Generator::generate()
next.addBody("return (pos < input.length()) ? input.at(pos++).toLower() : QChar();");
klass.addMember(Class::PublicMember, next);
}
-
+
/*
{
Function lexem("QString", "lexem()");
@@ -450,7 +450,7 @@ QString Generator::generate()
Function lexFunc;
lexFunc.setReturnType("int");
lexFunc.setName("lex()");
-
+
CodeBlock body;
body << "lexemStart = pos;";
body << "lexemLength = 0;";
@@ -487,14 +487,14 @@ QString Generator::generate()
body.outdent();
body.indent();
-
+
if (!dfa.at(i).transitions.isEmpty()) {
body << "ch = next();";
generateTransitions(body, dfa.at(i).transitions);
}
-
+
body << "goto out;";
-
+
body.outdent();
}
@@ -512,9 +512,9 @@ QString Generator::generate()
body.outdent();
body << "}";
body << "return token;";
-
+
lexFunc.addBody(body);
-
+
klass.addMember(Class::PublicMember, lexFunc);
QString header;
@@ -526,7 +526,7 @@ QString Generator::generate()
}
header += QLatin1String("// auto generated. DO NOT EDIT.\n");
-
+
return header + klass.declaration() + klass.definition();
}
diff --git a/util/lexgen/generator.h b/util/lexgen/generator.h
index 7037f13018..c56ee20756 100644
--- a/util/lexgen/generator.h
+++ b/util/lexgen/generator.h
@@ -82,11 +82,11 @@ public:
delete shared;
}
}
-
+
template <typename T>
LineStream &operator<<(const T &value)
{ (*shared->stream) << value; return *this; }
-
+
SharedStream *shared;
};
@@ -101,11 +101,11 @@ public:
template <typename T>
LineStream operator<<(const T &value)
{ stream << indentStr; stream << value; return LineStream(&stream); }
-
+
inline void addNewLine() { stream << endl; }
-
+
inline QString toString() const { stream.flush(); return output; }
-
+
private:
QString output;
mutable QTextStream stream;
@@ -121,20 +121,20 @@ public:
inline void setName(const QString &name) { fname = name; }
inline QString name() const { return fname; }
-
+
inline void setInline(bool i) { iline = i; }
inline bool isInline() const { return iline; }
-
+
inline void setReturnType(const QString &type) { rtype = type; }
inline QString returnType() const { return rtype; }
-
+
inline void addBody(const QString &_body) { body += _body; }
inline void addBody(const CodeBlock &block) { body += block.toString(); }
inline bool hasBody() const { return !body.isEmpty(); }
-
+
inline void setConst(bool konst) { cnst = konst; }
inline bool isConst() const { return cnst; }
-
+
void printDeclaration(CodeBlock &block, const QString &funcNamePrefix = QString()) const;
QString definition() const;
@@ -157,19 +157,19 @@ public:
inline void setName(const QString &name) { cname = name; }
inline QString name() const { return cname; }
-
+
inline void addMember(Access access, const QString &name)
{ sections[access].variables.append(name); }
inline void addMember(Access access, const Function &func)
{ sections[access].functions.append(func); }
-
+
void addConstructor(Access access, const QString &body, const QString &args = QString());
inline void addConstructor(Access access, const CodeBlock &body, const QString &args = QString())
{ addConstructor(access, body.toString(), args); }
-
+
QString declaration() const;
QString definition() const;
-
+
private:
QString cname;
struct Section
@@ -177,10 +177,10 @@ private:
QVector<Function> functions;
QStringList variables;
QVector<Function> constructors;
-
+
inline bool isEmpty() const
{ return functions.isEmpty() && variables.isEmpty() && constructors.isEmpty(); }
-
+
void printDeclaration(const Class *klass, CodeBlock &block) const;
QString definition(const Class *klass) const;
};
@@ -192,9 +192,9 @@ class Generator
{
public:
Generator(const DFA &dfa, const Config &config);
-
+
QString generate();
-
+
private:
void generateTransitions(CodeBlock &body, const TransitionMap &transitions);
bool isSingleReferencedFinalState(int i) const;
diff --git a/util/lexgen/main.cpp b/util/lexgen/main.cpp
index 7fdf587ae9..a6cd6ee94f 100644
--- a/util/lexgen/main.cpp
+++ b/util/lexgen/main.cpp
@@ -149,7 +149,7 @@ static QSet<InputType> determineMaxInputSet(const ConfigFile::Section &section)
if (inputTypeName == "quint8") {
for (int i = 1; i < 256; ++i)
set.insert(i);
- } /* else if ### */
+ } /* else if ### */
else {
qWarning("Error: Unknown input type '%s'", qPrintable(inputTypeName));
return QSet<InputType>();
@@ -313,7 +313,7 @@ int main(int argc, char **argv)
qDebug() << "Error while tokenizing!";
} else {
Generator gen(machine, cfg);
- QTextStream(stdout)
+ QTextStream(stdout)
<< gen.generate();
}
diff --git a/util/lexgen/nfa.cpp b/util/lexgen/nfa.cpp
index 5ae3beade5..1414d1eedd 100644
--- a/util/lexgen/nfa.cpp
+++ b/util/lexgen/nfa.cpp
@@ -288,7 +288,6 @@ DFA NFA::toDFA() const
if (transition.key() == Epsilon && epsilonStates.contains(transition.value()))
epsilonStates.insert(i, epsilonStates.value(transition.value()));
}
-
} while (lastCount != epsilonStates.count());
for (int i = 0; i < states.count(); ++i) {
@@ -313,7 +312,6 @@ DFA NFA::toDFA() const
*/
}
-
QSet<InputType> validInput;
foreach (const State &s, states)
for (TransitionMap::ConstIterator it = s.transitions.constBegin(),
@@ -504,5 +502,3 @@ DFA DFA::minimize() const
return *this;
}
-
-
diff --git a/util/lexgen/nfa.h b/util/lexgen/nfa.h
index 3eae9bcef8..0d8394a926 100644
--- a/util/lexgen/nfa.h
+++ b/util/lexgen/nfa.h
@@ -92,7 +92,7 @@ public:
static NFA applyQuantity(const NFA &a, int minOccurrences, int maxOccurrences);
void setTerminationSymbol(const QString &symbol);
-
+
DFA toDFA() const;
inline bool isEmpty() const { return states.isEmpty(); }
@@ -113,7 +113,7 @@ private:
inline void assertValidState(int state)
{ Q_UNUSED(state); Q_ASSERT(state >= 0); Q_ASSERT(state < states.count()); }
-
+
#if defined(AUTOTEST)
public:
#endif
diff --git a/util/lexgen/tests/tst_lexgen.cpp b/util/lexgen/tests/tst_lexgen.cpp
index a3741d2373..f45d295633 100644
--- a/util/lexgen/tests/tst_lexgen.cpp
+++ b/util/lexgen/tests/tst_lexgen.cpp
@@ -227,7 +227,7 @@ void tst_LexGen::lexgen_data()
d.cd("testdata");
foreach (QString test, d.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) {
QString dir = d.absoluteFilePath(test) + '/';
- QTest::newRow(qPrintable(test))
+ QTest::newRow(qPrintable(test))
<< dir + "rules.lexgen"
<< dir + "input"
<< dir + "output"
diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py
index 7d802e7492..b5935ca45f 100644
--- a/util/local_database/enumdata.py
+++ b/util/local_database/enumdata.py
@@ -173,7 +173,7 @@ language_list = {
125 : [ "Turkish", "tr" ],
126 : [ "Turkmen", "tk" ],
127 : [ "Tahitian", "ty" ],
- 128 : [ "Uigur", "ug" ],
+ 128 : [ "Uighur", "ug" ],
129 : [ "Ukrainian", "uk" ],
130 : [ "Urdu", "ur" ],
131 : [ "Uzbek", "uz" ], # macrolanguage
@@ -305,7 +305,58 @@ language_list = {
257 : [ "Ngomba", "jgo" ],
258 : [ "Kako", "kkj" ],
259 : [ "Meta", "mgo" ],
- 260 : [ "Ngiemboon", "nnh" ]
+ 260 : [ "Ngiemboon", "nnh" ],
+ 261 : [ "Aragonese", "an" ],
+ 262 : [ "Akkadian", "akk" ],
+ 263 : [ "AncientEgyptian", "egy" ],
+ 264 : [ "AncientGreek", "grc" ],
+ 265 : [ "Aramaic", "arc" ],
+ 266 : [ "Balinese", "ban" ],
+ 267 : [ "Bamun", "bax" ],
+ 268 : [ "BatakToba", "bbc" ],
+ 269 : [ "Buginese", "bug" ],
+ 270 : [ "Buhid", "bku" ],
+ 271 : [ "Carian", "xcr" ],
+ 272 : [ "Chakma", "ccp" ],
+ 273 : [ "ClassicalMandaic", "myz" ],
+ 274 : [ "Coptic", "cop" ],
+ 275 : [ "Dogri", "doi" ], # macrolanguage
+ 276 : [ "EasternCham", "cjm" ],
+ 277 : [ "EasternKayah", "eky" ],
+ 278 : [ "Etruscan", "ett" ],
+ 279 : [ "Gothic", "got" ],
+ 280 : [ "Hanunoo", "hnn" ],
+ 281 : [ "Ingush", "inh" ],
+ 282 : [ "LargeFloweryMiao", "hmd" ],
+ 283 : [ "Lepcha", "lep" ],
+ 284 : [ "Limbu", "lif" ],
+ 285 : [ "Lisu", "lis" ],
+ 286 : [ "Lu", "khb" ],
+ 287 : [ "Lycian", "xlc" ],
+ 288 : [ "Lydian", "xld" ],
+ 289 : [ "Mandingo", "man" ], # macrolanguage
+ 290 : [ "Manipuri", "mni" ],
+ 291 : [ "Meroitic", "xmr" ],
+ 292 : [ "NorthernThai", "nod" ],
+ 293 : [ "OldIrish", "sga" ],
+ 294 : [ "OldNorse", "non" ],
+ 295 : [ "OldPersian", "peo" ],
+ 296 : [ "OldTurkish", "otk" ],
+ 297 : [ "Pahlavi", "pal" ],
+ 298 : [ "Parthian", "xpr" ],
+ 299 : [ "Phoenician", "phn" ],
+ 300 : [ "PrakritLanguage", "pra" ],
+ 301 : [ "Rejang", "rej" ],
+ 302 : [ "Sabaean", "xsa" ],
+ 303 : [ "Samaritan", "smp" ],
+ 304 : [ "Santali", "sat" ],
+ 305 : [ "Saurashtra", "saz" ],
+ 306 : [ "Sora", "srb" ],
+ 307 : [ "Sylheti", "syl" ],
+ 308 : [ "Tagbanwa", "tbw" ],
+ 309 : [ "TaiDam", "blt" ],
+ 310 : [ "TaiNua", "tdd" ],
+ 311 : [ "Ugaritic", "uga" ]
}
country_list = {
@@ -602,9 +653,84 @@ script_list = {
30 : [ "Thai", "Thai" ],
31 : [ "Tibetan", "Tibt" ],
32 : [ "Sinhala", "Sinh" ],
- 33 : [ "Syriac", "Syri" ],
+ 33 : [ "Syriac", "Syrc" ],
34 : [ "Yi", "Yiii" ],
- 35 : [ "Vai", "Vaii" ]
+ 35 : [ "Vai", "Vaii" ],
+ 36 : [ "Avestan", "Avst" ],
+ 37 : [ "Balinese", "Bali" ],
+ 38 : [ "Bamum", "Bamu" ],
+ 39 : [ "Batak", "Batk" ],
+ 40 : [ "Bopomofo", "Bopo" ],
+ 41 : [ "Brahmi", "Brah" ],
+ 42 : [ "Buginese", "Bugi" ],
+ 43 : [ "Buhid", "Buhd" ],
+ 44 : [ "CanadianAboriginal", "Cans" ],
+ 45 : [ "Carian", "Cari" ],
+ 46 : [ "Chakma", "Cakm" ],
+ 47 : [ "Cham", "Cham" ],
+ 48 : [ "Coptic", "Copt" ],
+ 49 : [ "Cypriot", "Cprt" ],
+ 50 : [ "Egyptian Hieroglyphs", "Egyp" ],
+ 51 : [ "Fraser", "Lisu" ],
+ 52 : [ "Glagolitic", "Glag" ],
+ 53 : [ "Gothic", "Goth" ],
+ 54 : [ "Han", "Hani" ],
+ 55 : [ "Hangul", "Hang" ],
+ 56 : [ "Hanunoo", "Hano" ],
+ 57 : [ "Imperial Aramaic", "Armi" ],
+ 58 : [ "Inscriptional Pahlavi", "Phli" ],
+ 59 : [ "Inscriptional Parthian", "Prti" ],
+ 60 : [ "Javanese", "Java" ],
+ 61 : [ "Kaithi", "Kthi" ],
+ 62 : [ "Katakana", "Kana" ],
+ 63 : [ "Kayah Li", "Kali" ],
+ 64 : [ "Kharoshthi", "Khar" ],
+ 65 : [ "Lanna", "Lana" ],
+ 66 : [ "Lepcha", "Lepc" ],
+ 67 : [ "Limbu", "Limb" ],
+ 68 : [ "Linear B", "Linb" ],
+ 69 : [ "Lycian", "Lyci" ],
+ 70 : [ "Lydian", "Lydi" ],
+ 71 : [ "Mandaean", "Mand" ],
+ 72 : [ "Meitei Mayek", "Mtei" ],
+ 73 : [ "Meroitic", "Mero" ],
+ 74 : [ "Meroitic Cursive", "Merc" ],
+ 75 : [ "Nko", "Nkoo" ],
+ 76 : [ "New Tai Lue", "Talu" ],
+ 77 : [ "Ogham", "Ogam" ],
+ 78 : [ "Ol Chiki", "Olck" ],
+ 79 : [ "Old Italic", "Ital" ],
+ 80 : [ "Old Persian", "Xpeo" ],
+ 81 : [ "Old South Arabian", "Sarb" ],
+ 82 : [ "Orkhon", "Orkh" ],
+ 83 : [ "Osmanya", "Osma" ],
+ 84 : [ "Phags Pa", "Phag" ],
+ 85 : [ "Phoenician", "Phnx" ],
+ 86 : [ "Pollard Phonetic", "Plrd" ],
+ 87 : [ "Rejang", "Rjng" ],
+ 88 : [ "Runic", "Runr" ],
+ 89 : [ "Samaritan", "Samr" ],
+ 90 : [ "Saurashtra", "Saur" ],
+ 91 : [ "Sharada", "Shrd" ],
+ 92 : [ "Shavian", "Shaw" ],
+ 93 : [ "Sora Sompeng", "Sora" ],
+ 94 : [ "Cuneiform", "Xsux" ],
+ 95 : [ "Sundanese", "Sund" ],
+ 96 : [ "Syloti Nagri", "Sylo" ],
+ 97 : [ "Tagalog", "Tglg" ],
+ 98 : [ "Tagbanwa", "Tagb" ],
+ 99 : [ "Tai Le", "Tale" ],
+ 100 : [ "Tai Viet", "Tavt" ],
+ 101 : [ "Takri", "Takr" ],
+ 102 : [ "Ugaritic", "Ugar" ],
+ 103 : [ "Braille", "Brai" ],
+ 104 : [ "Hiragana", "Hira" ]
+
+# ### : [ "Blissymbols", "Blis" ],
+# ### : [ "Linear A", "Lina" ],
+# ### : [ "Naxi Geba", "Nkgb" ],
+# ### : [ "Pahawh Hmong", "Hmng" ],
+# ### : [ "Varang Kshiti", "Wara" ],
}
def countryCodeToId(code):
diff --git a/util/local_database/qlocalexml2cpp.py b/util/local_database/qlocalexml2cpp.py
index d3120d256f..f52979f6b6 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/local_database/qlocalexml2cpp.py
@@ -554,7 +554,7 @@ def main():
if to_language != 0:
cmnt_to = cmnt_to + language_map[to_language][1]
else:
- cmnt_from = cmnt_from + "und"
+ cmnt_to = cmnt_to + "und"
if to_script != 0:
if cmnt_to:
cmnt_to = cmnt_to + "_"
@@ -899,6 +899,7 @@ def main():
qlocaleh_temp_file.write(" RhaetoRomance = Romansh,\n")
qlocaleh_temp_file.write(" Chewa = Nyanja,\n")
qlocaleh_temp_file.write(" Frisian = WesternFrisian,\n")
+ qlocaleh_temp_file.write(" Uigur = Uighur,\n")
qlocaleh_temp_file.write(" LastLanguage = " + language + "\n")
qlocaleh_temp_file.write(" };\n")
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 6a134695f9..5affaeb59f 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -540,6 +540,137 @@ static void initLineBreak()
}
+static QHash<QByteArray, QChar::Script> scriptMap;
+
+static void initScriptMap()
+{
+ struct Scrpt {
+ QChar::Script script;
+ const char *name;
+ } scripts[] = {
+ // general
+ { QChar::Script_Unknown, "Unknown" },
+ { QChar::Script_Inherited, "Inherited" },
+ { QChar::Script_Common, "Common" },
+ // pre-4.0
+ { QChar::Script_Latin, "Latin" },
+ { QChar::Script_Greek, "Greek" },
+ { QChar::Script_Cyrillic, "Cyrillic" },
+ { QChar::Script_Armenian, "Armenian" },
+ { QChar::Script_Hebrew, "Hebrew" },
+ { QChar::Script_Arabic, "Arabic" },
+ { QChar::Script_Syriac, "Syriac" },
+ { QChar::Script_Thaana, "Thaana" },
+ { QChar::Script_Devanagari, "Devanagari" },
+ { QChar::Script_Bengali, "Bengali" },
+ { QChar::Script_Gurmukhi, "Gurmukhi" },
+ { QChar::Script_Gujarati, "Gujarati" },
+ { QChar::Script_Oriya, "Oriya" },
+ { QChar::Script_Tamil, "Tamil" },
+ { QChar::Script_Telugu, "Telugu" },
+ { QChar::Script_Kannada, "Kannada" },
+ { QChar::Script_Malayalam, "Malayalam" },
+ { QChar::Script_Sinhala, "Sinhala" },
+ { QChar::Script_Thai, "Thai" },
+ { QChar::Script_Lao, "Lao" },
+ { QChar::Script_Tibetan, "Tibetan" },
+ { QChar::Script_Myanmar, "Myanmar" },
+ { QChar::Script_Georgian, "Georgian" },
+ { QChar::Script_Hangul, "Hangul" },
+ { QChar::Script_Ethiopic, "Ethiopic" },
+ { QChar::Script_Cherokee, "Cherokee" },
+ { QChar::Script_CanadianAboriginal, "CanadianAboriginal" },
+ { QChar::Script_Ogham, "Ogham" },
+ { QChar::Script_Runic, "Runic" },
+ { QChar::Script_Khmer, "Khmer" },
+ { QChar::Script_Mongolian, "Mongolian" },
+ { QChar::Script_Hiragana, "Hiragana" },
+ { QChar::Script_Katakana, "Katakana" },
+ { QChar::Script_Bopomofo, "Bopomofo" },
+ { QChar::Script_Han, "Han" },
+ { QChar::Script_Yi, "Yi" },
+ { QChar::Script_OldItalic, "OldItalic" },
+ { QChar::Script_Gothic, "Gothic" },
+ { QChar::Script_Deseret, "Deseret" },
+ { QChar::Script_Tagalog, "Tagalog" },
+ { QChar::Script_Hanunoo, "Hanunoo" },
+ { QChar::Script_Buhid, "Buhid" },
+ { QChar::Script_Tagbanwa, "Tagbanwa" },
+ { QChar::Script_Coptic, "Coptic" },
+ // 4.0
+ { QChar::Script_Limbu, "Limbu" },
+ { QChar::Script_TaiLe, "TaiLe" },
+ { QChar::Script_LinearB, "LinearB" },
+ { QChar::Script_Ugaritic, "Ugaritic" },
+ { QChar::Script_Shavian, "Shavian" },
+ { QChar::Script_Osmanya, "Osmanya" },
+ { QChar::Script_Cypriot, "Cypriot" },
+ { QChar::Script_Braille, "Braille" },
+ // 4.1
+ { QChar::Script_Buginese, "Buginese" },
+ { QChar::Script_NewTaiLue, "NewTaiLue" },
+ { QChar::Script_Glagolitic, "Glagolitic" },
+ { QChar::Script_Tifinagh, "Tifinagh" },
+ { QChar::Script_SylotiNagri, "SylotiNagri" },
+ { QChar::Script_OldPersian, "OldPersian" },
+ { QChar::Script_Kharoshthi, "Kharoshthi" },
+ // 5.0
+ { QChar::Script_Balinese, "Balinese" },
+ { QChar::Script_Cuneiform, "Cuneiform" },
+ { QChar::Script_Phoenician, "Phoenician" },
+ { QChar::Script_PhagsPa, "PhagsPa" },
+ { QChar::Script_Nko, "Nko" },
+ // 5.1
+ { QChar::Script_Sundanese, "Sundanese" },
+ { QChar::Script_Lepcha, "Lepcha" },
+ { QChar::Script_OlChiki, "OlChiki" },
+ { QChar::Script_Vai, "Vai" },
+ { QChar::Script_Saurashtra, "Saurashtra" },
+ { QChar::Script_KayahLi, "KayahLi" },
+ { QChar::Script_Rejang, "Rejang" },
+ { QChar::Script_Lycian, "Lycian" },
+ { QChar::Script_Carian, "Carian" },
+ { QChar::Script_Lydian, "Lydian" },
+ { QChar::Script_Cham, "Cham" },
+ // 5.2
+ { QChar::Script_TaiTham, "TaiTham" },
+ { QChar::Script_TaiViet, "TaiViet" },
+ { QChar::Script_Avestan, "Avestan" },
+ { QChar::Script_EgyptianHieroglyphs, "EgyptianHieroglyphs" },
+ { QChar::Script_Samaritan, "Samaritan" },
+ { QChar::Script_Lisu, "Lisu" },
+ { QChar::Script_Bamum, "Bamum" },
+ { QChar::Script_Javanese, "Javanese" },
+ { QChar::Script_MeeteiMayek, "MeeteiMayek" },
+ { QChar::Script_ImperialAramaic, "ImperialAramaic" },
+ { QChar::Script_OldSouthArabian, "OldSouthArabian" },
+ { QChar::Script_InscriptionalParthian, "InscriptionalParthian" },
+ { QChar::Script_InscriptionalPahlavi, "InscriptionalPahlavi" },
+ { QChar::Script_OldTurkic, "OldTurkic" },
+ { QChar::Script_Kaithi, "Kaithi" },
+ // 6.0
+ { QChar::Script_Batak, "Batak" },
+ { QChar::Script_Brahmi, "Brahmi" },
+ { QChar::Script_Mandaic, "Mandaic" },
+ // 6.1
+ { QChar::Script_Chakma, "Chakma" },
+ { QChar::Script_MeroiticCursive, "MeroiticCursive" },
+ { QChar::Script_MeroiticHieroglyphs, "MeroiticHieroglyphs" },
+ { QChar::Script_Miao, "Miao" },
+ { QChar::Script_Sharada, "Sharada" },
+ { QChar::Script_SoraSompeng, "SoraSompeng" },
+ { QChar::Script_Takri, "Takri" },
+ // unhandled
+ { QChar::Script_Unknown, 0 }
+ };
+ Scrpt *p = scripts;
+ while (p->name) {
+ scriptMap.insert(p->name, p->script);
+ ++p;
+ }
+}
+
+
// Keep this one in sync with the code in createPropertyInfo
static const char *property_string =
"struct Properties {\n"
@@ -562,7 +693,7 @@ static const char *property_string =
" ushort wordBreakClass : 8; /* 4 used */\n"
" ushort sentenceBreakClass : 8; /* 4 used */\n"
" ushort lineBreakClass : 8; /* 6 used */\n"
- " ushort script : 8; /* 5 used */\n"
+ " ushort script : 8; /* 7 used */\n"
"};\n\n"
"Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);\n"
"Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);\n"
@@ -584,10 +715,6 @@ static const char *methods =
"Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);\n"
"inline LineBreakClass lineBreakClass(QChar ch)\n"
"{ return lineBreakClass(ch.unicode()); }\n"
- "\n"
- "Q_CORE_EXPORT Script QT_FASTCALL script(uint ucs4);\n"
- "inline Script script(QChar ch)\n"
- "{ return script(ch.unicode()); }\n"
"\n";
static const int SizeOfPropertiesStruct = 20;
@@ -745,7 +872,7 @@ struct UnicodeData {
p.graphemeBreakClass = GraphemeBreak_Other;
p.wordBreakClass = WordBreak_Other;
p.sentenceBreakClass = SentenceBreak_Other;
- p.script = 0; // Common
+ p.script = QChar::Script_Unknown;
propertyIndex = -1;
excludedComposition = false;
}
@@ -1830,42 +1957,6 @@ static void readBlocks()
}
#endif
-static QList<QByteArray> scriptNames;
-static QList<int> scriptMap;
-
-static const char *specialScripts[] = {
- "Common",
- "Greek",
- "Cyrillic",
- "Armenian",
- "Hebrew",
- "Arabic",
- "Syriac",
- "Thaana",
- "Devanagari",
- "Bengali",
- "Gurmukhi",
- "Gujarati",
- "Oriya",
- "Tamil",
- "Telugu",
- "Kannada",
- "Malayalam",
- "Sinhala",
- "Thai",
- "Lao",
- "Tibetan",
- "Myanmar",
- "Georgian",
- "Hangul",
- "Ogham",
- "Runic",
- "Khmer",
- "Nko",
- "Inherited"
-};
-enum { specialScriptsCount = sizeof(specialScripts) / sizeof(const char *) };
-
static void readScripts()
{
qDebug("Reading Scripts.txt");
@@ -1876,13 +1967,6 @@ static void readScripts()
f.open(QFile::ReadOnly);
- int scriptsCount = specialScriptsCount;
- // ### preserve the old ordering (temporary)
- for (int i = 0; i < specialScriptsCount; ++i) {
- scriptNames.append(specialScripts[i]);
- scriptMap.append(i);
- }
-
while (!f.atEnd()) {
QByteArray line = f.readLine();
line.resize(line.size() - 1);
@@ -1914,57 +1998,17 @@ static void readScripts()
Q_ASSERT(ok);
}
- int scriptIndex = scriptNames.indexOf(scriptName);
- if (scriptIndex == -1) {
- scriptIndex = scriptNames.size();
- scriptNames.append(scriptName);
-
- // is the script alias for 'Common'?
- int s = specialScriptsCount;
- while (--s > 0) {
- if (scriptName == specialScripts[s])
- break;
- }
- scriptMap.append(s > 0 ? scriptsCount++ : 0);
- }
+ if (!scriptMap.contains(scriptName))
+ qFatal("Unhandled script property value: %s", scriptName.constData());
+ QChar::Script script = scriptMap.value(scriptName, QChar::Script_Unknown);
for (int codepoint = first; codepoint <= last; ++codepoint) {
UnicodeData &ud = UnicodeData::valueRef(codepoint);
- ud.p.script = scriptMap.at(scriptIndex);
+ ud.p.script = script;
}
}
}
-static QByteArray createScriptEnumDeclaration()
-{
- QByteArray declaration;
-
- declaration += "// See http://www.unicode.org/reports/tr24/tr24-5.html\n";
- declaration += "enum Script {\n Common";
-
- // output the ones with special processing first
- for (int i = 1; i < scriptNames.size(); ++i) {
- if (scriptMap.at(i) == 0)
- continue;
- declaration += ",\n ";
- declaration += scriptNames.at(i);
- }
- declaration += ",\n ScriptCount = Inherited";
-
- // output the ones that are an alias for 'Common'
- for (int i = 1; i < scriptNames.size(); ++i) {
- if (scriptMap.at(i) != 0)
- continue;
- declaration += ",\n ";
- declaration += scriptNames.at(i);
- declaration += " = Common";
- }
-
- declaration += "\n};\n\n";
-
- return declaration;
-}
-
#if 0
static void dump(int from, int to)
{
@@ -2214,7 +2258,7 @@ static QByteArray createPropertyInfo()
out += ", ";
out += QByteArray::number( p.lineBreakClass );
out += ", ";
-// " ushort script : 8; /* 5 used */\n"
+// " ushort script : 8; /* 7 used */\n"
out += QByteArray::number( p.script );
out += " },";
}
@@ -2263,11 +2307,7 @@ static QByteArray createPropertyInfo()
"{\n"
" return (LineBreakClass)qGetProp(ucs4)->lineBreakClass;\n"
"}\n"
- "\n"
- "Q_CORE_EXPORT Script QT_FASTCALL script(uint ucs4)\n"
- "{\n"
- " return (Script)qGetProp(ucs4)->script;\n"
- "}\n\n";
+ "\n";
return out;
}
@@ -2725,6 +2765,7 @@ int main(int, char **)
initWordBreak();
initSentenceBreak();
initLineBreak();
+ initScriptMap();
readUnicodeData();
readBidiMirroring();
@@ -2746,7 +2787,6 @@ int main(int, char **)
QByteArray compositions = createCompositionInfo();
QByteArray ligatures = createLigatureInfo();
QByteArray normalizationCorrections = createNormalizationCorrections();
- QByteArray scriptEnumDeclaration = createScriptEnumDeclaration();
QByteArray header =
"/****************************************************************************\n"
@@ -2837,7 +2877,6 @@ int main(int, char **)
f.write("#define UNICODE_DATA_VERSION "DATA_VERSION_STR"\n\n");
f.write("namespace QUnicodeTables {\n\n");
f.write(property_string);
- f.write(scriptEnumDeclaration);
f.write(grapheme_break_class_string);
f.write(word_break_class_string);
f.write(sentence_break_class_string);