From e0c0e83fd5534b24f18d5e02a453182df54933e0 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 15 Oct 2012 14:16:51 +0200 Subject: Add ANGLE as a 3rdparty library to Qt. ANGLE is a component that implements the OpenGL ES 2.0 API on top of DirectX 9. See the following for more info: http://code.google.com/p/angleproject/ ANGLE is now the default configuration on Windows. If you want to use desktop OpenGL, you should build Qt with the following configure options: -opengl desktop To configure Qt to use another OpenGL ES 2 implementation, you should use: -opengl es2 -no-angle Task-number: QTBUG-24207 Change-Id: Iefcbeaa37ed920f431729749ab8333b248fe5134 Reviewed-by: Friedemann Kleint --- tools/configure/configureapp.cpp | 60 +++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8cf559e6df..1b75def13f 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -291,6 +291,8 @@ Configure::Configure(int& argc, char** argv) dictionary[ "ICU" ] = "auto"; + dictionary[ "ANGLE" ] = "auto"; + dictionary[ "GIF" ] = "auto"; dictionary[ "JPEG" ] = "auto"; dictionary[ "PNG" ] = "auto"; @@ -300,6 +302,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "ACCESSIBILITY" ] = "yes"; dictionary[ "OPENGL" ] = "yes"; + dictionary[ "OPENGL_ES_2" ] = "yes"; dictionary[ "OPENVG" ] = "no"; dictionary[ "OPENSSL" ] = "auto"; dictionary[ "DBUS" ] = "auto"; @@ -545,6 +548,12 @@ void Configure::parseCmdLine() dictionary[ "ICU" ] = "no"; } + else if (configCmdLine.at(i) == "-angle") { + dictionary[ "ANGLE" ] = "yes"; + } else if (configCmdLine.at(i) == "-no-angle") { + dictionary[ "ANGLE" ] = "no"; + } + // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; @@ -663,6 +672,7 @@ void Configure::parseCmdLine() if (i == argCount) break; + dictionary[ "OPENGL_ES_2" ] = "no"; if (configCmdLine.at(i) == "es1") { dictionary[ "OPENGL_ES_CM" ] = "yes"; } else if ( configCmdLine.at(i) == "es2" ) { @@ -674,16 +684,6 @@ void Configure::parseCmdLine() dictionary[ "DONE" ] = "error"; break; } - // External location of ANGLE library (Open GL ES 2) - } else if (configCmdLine.at(i) == QStringLiteral("-angle")) { - if (++i == argCount) - break; - const QFileInfo fi(configCmdLine.at(i)); - if (!fi.isDir()) { - cout << "Argument passed to -angle option is not a directory." << endl; - dictionary.insert(QStringLiteral("DONE"), QStringLiteral( "error")); - } - dictionary.insert(QStringLiteral("ANGLE_DIR"), fi.absoluteFilePath()); } // OpenVG Support ------------------------------------------- @@ -1646,9 +1646,9 @@ bool Configure::displayHelp() desc("OPENGL", "no","-no-opengl", "Do not support OpenGL."); desc("OPENGL", "no","-opengl ", "Enable OpenGL support with specified API version.\n" "Available values for :"); - desc("", "", "", " desktop - Enable support for Desktop OpenGL", ' '); + desc("", "no", "", " desktop - Enable support for Desktop OpenGL", ' '); desc("OPENGL_ES_CM", "no", "", " es1 - Enable support for OpenGL ES Common Profile", ' '); - desc("OPENGL_ES_2", "no", "", " es2 - Enable support for OpenGL ES 2.0\n", ' '); + desc("OPENGL_ES_2", "yes", "", " es2 - Enable support for OpenGL ES 2.0\n", ' '); desc("OPENVG", "no","-no-openvg", "Disables OpenVG functionality."); desc("OPENVG", "yes","-openvg", "Enables OpenVG functionality.\n"); @@ -1724,6 +1724,9 @@ bool Configure::displayHelp() desc("SLOG2", "yes", "-slog2", "Compile with slog2 support."); desc("SLOG2", "no", "-no-slog2", "Do not compile with slog2 support."); } + + desc("ANGLE", "yes", "-angle", "Use the ANGLE implementation of OpenGL ES 2.0."); + desc("ANGLE", "no", "-no-angle", "Do not use ANGLE.\nSee http://code.google.com/p/angleproject/\n"); #endif // Qt\Windows only options go below here -------------------------------------------------------------------------------- desc("\nQt for Windows only:\n\n"); @@ -1736,7 +1739,6 @@ bool Configure::displayHelp() desc("PLUGIN_MANIFESTS", "no", "-no-plugin-manifests", "Do not embed manifests in plugins."); desc("PLUGIN_MANIFESTS", "yes", "-plugin-manifests", "Embed manifests in plugins.\n"); - desc( "-angle ", "Use ANGLE library from location .\n"); #if !defined(EVAL) desc("BUILD_QMAKE", "no", "-no-qmake", "Do not compile qmake."); desc("BUILD_QMAKE", "yes", "-qmake", "Compile qmake.\n"); @@ -1881,6 +1883,9 @@ bool Configure::findFile(const QString &fileName) } } paths = QString::fromLocal8Bit(getenv("INCLUDE")); + const QByteArray directXSdk = qgetenv("DXSDK_DIR"); + if (!directXSdk.isEmpty()) // Add Direct X SDK for ANGLE + paths += QLatin1Char(';') + QString::fromLocal8Bit(directXSdk) + QLatin1String("/include"); } else if (file.endsWith(".lib") || file.endsWith(".a")) { if (!mingwPath.isNull() && !findFileInPaths(file, mingwPaths(mingwPath, "lib")).isNull()) return true; @@ -1967,6 +1972,9 @@ bool Configure::checkAvailability(const QString &part) available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h") && (findFile("icuin.lib") || findFile("libicuin.lib")); // libicun.lib if compiled with mingw + else if (part == "ANGLE") + available = findFile("d3dcompiler.h"); + else if (part == "LIBJPEG") available = findFile("jpeglib.h"); else if (part == "LIBPNG") @@ -2090,6 +2098,12 @@ void Configure::autoDetection() if (dictionary["ICU"] == "auto") dictionary["ICU"] = checkAvailability("ICU") ? "yes" : "no"; + // ANGLE detection + if (dictionary["ANGLE"] == "auto") { + bool gles2 = (dictionary["OPENGL_ES_2"] == "yes"); + dictionary["ANGLE"] = (gles2 && checkAvailability("ANGLE")) ? "yes" : "no"; + } + // Image format detection if (dictionary["GIF"] == "auto") dictionary["GIF"] = defaultTo("GIF"); @@ -2329,6 +2343,10 @@ void Configure::generateOutputVars() if (dictionary[ "ICU" ] == "yes") qtConfig += "icu"; + // ANGLE -------------------------------------------------------- + if (dictionary[ "ANGLE" ] == "yes") + qtConfig += "angle"; + // Image formates ----------------------------------------------- if (dictionary[ "GIF" ] == "no") qtConfig += "no-gif"; @@ -2986,16 +3004,6 @@ void Configure::generateQConfigPri() if (!dictionary["QT_NAMESPACE"].isEmpty()) configStream << "#namespaces" << endl << "QT_NAMESPACE = " << dictionary["QT_NAMESPACE"] << endl; - if (dictionary.value(QStringLiteral("OPENGL_ES_2")) == QStringLiteral("yes")) { - const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR")); - if (!angleDir.isEmpty()) { - configStream - << "QMAKE_INCDIR_OPENGL_ES2 = " << angleDir << "/include\n" - << "QMAKE_LIBDIR_OPENGL_ES2_DEBUG = " << angleDir << "/lib/Debug\n" - << "QMAKE_LIBDIR_OPENGL_ES2_RELEASE = " << angleDir << "/lib/Release\n"; - } - } - configStream.flush(); configFile.close(); } @@ -3315,11 +3323,6 @@ void Configure::displayConfig() sout << "Iconv support..............." << dictionary[ "QT_ICONV" ] << endl; sout << "Glib support................" << dictionary[ "QT_GLIB" ] << endl; sout << "CUPS support................" << dictionary[ "QT_CUPS" ] << endl; - if (dictionary.value(QStringLiteral("OPENGL_ES_2")) == QStringLiteral("yes")) { - const QString angleDir = dictionary.value(QStringLiteral("ANGLE_DIR")); - if (!angleDir.isEmpty()) - sout << "ANGLE......................." << QDir::toNativeSeparators(angleDir) << endl; - } sout << "OpenVG support.............." << dictionary[ "OPENVG" ] << endl; sout << "OpenSSL support............." << dictionary[ "OPENSSL" ] << endl; sout << "QtDBus support.............." << dictionary[ "DBUS" ] << endl; @@ -3337,6 +3340,7 @@ void Configure::displayConfig() sout << " ICU support............." << dictionary[ "ICU" ] << endl; if ((platform() == QNX) || (platform() == BLACKBERRY)) sout << " SLOG2 support..........." << dictionary[ "SLOG2" ] << endl; + sout << " ANGLE..................." << dictionary[ "ANGLE" ] << endl; sout << "Styles:" << endl; sout << " Windows................." << dictionary[ "STYLE_WINDOWS" ] << endl; -- cgit v1.2.3