static void qt5_gui_init(void)
{
- QCoreApplication::setApplicationName(EMULATOR_TITLE);
-
- qInfo() << "* Qt version (compile time):" << QT_VERSION_STR;
- qInfo() << "* Qt version (runtime):" << qVersion();
- qInfo() << "* working path:" << QDir::currentPath();
- qInfo() << "* binary path:" << QCoreApplication::applicationDirPath();
-
uiInfo = new UiInformation();
/* parameter parsing */
sfcFormat.setAlphaBufferSize(8);
sfcFormat.setDepthBufferSize(24);
sfcFormat.setStencilBufferSize(8);
-#ifdef CONFIG_DARWIN
- // The default OpenGL version for QSurfaceFormat is 2.0.
- if (!isForceLegacy) {
+
+ if (isForceLegacy) {
+ sfcFormat.setMajorVersion(2);
+ sfcFormat.setMinorVersion(1);
+ } else {
sfcFormat.setMajorVersion(3);
sfcFormat.setMinorVersion(2);
sfcFormat.setProfile(QSurfaceFormat::CoreProfile);
}
-#else
- sfcFormat.setMajorVersion(3);
- sfcFormat.setMinorVersion(1);
-#endif
QSurfaceFormat::setDefaultFormat(sfcFormat);
}
qt5App = new QApplication(argc, argv);
- /* add the path in the application's main() function, right after the
- * QApplication object is created */
- qt5App->addLibraryPath(QDir::currentPath()); //TODO: consider a symbolic link
+ // add the path in the application's main() function,
+ // right after the QApplication object is created.
+ // TODO: consider a symbolic link
+ qt5App->addLibraryPath(QDir::currentPath());
qInstallMessageHandler(qMessageOutput);
-
- qDebug() << "* Qt plugin library path:" << QCoreApplication::libraryPaths();
-
#ifdef CONFIG_WIN32
eventFilter = new EventFilter();
qt5App->installNativeEventFilter(eventFilter);
#endif
if (qt5IsOnscreen) {
qt5GLContext = QOpenGLContext::globalShareContext();
+ qDebug("* Qt global share context: OpenGL %d.%d(Profile:%d)",
+ qt5GLContext->format().majorVersion(),
+ qt5GLContext->format().minorVersion(),
+ qt5GLContext->format().profile());
+
+// There are 2 issues:
+// With some Radeon GPU, the Qt5 library makes error with glCreateShader,
+// compilation error like below in Qt5 internal implementations:
+// Implicit version number 110 not supported by GL3 forward compatible context
+// And the issue that happens with the force legacy.(gl_version=2).
+// This code is W/A to experience,
+// I do not know the exact cause and solution.(IMHO, it is a Qt's bug.)
+// On Mac OS X(macOS), must explicitly usr the OpenGL version, exclude.
+#ifndef CONFIG_DARWIN
+ if (!isForceLegacy) {
+ QSurfaceFormat defFormat = QSurfaceFormat::defaultFormat();
+ defFormat.setMajorVersion(2);
+ defFormat.setMinorVersion(1);
+ defFormat.setProfile(QSurfaceFormat::NoProfile);
+ QSurfaceFormat::setDefaultFormat(defFormat);
+ }
+#endif
+ qDebug("* Qt requested default format: OpenGL %d.%d(Profile:%d)",
+ QSurfaceFormat::defaultFormat().majorVersion(),
+ QSurfaceFormat::defaultFormat().minorVersion(),
+ QSurfaceFormat::defaultFormat().profile());
}
+ QCoreApplication::setApplicationName(EMULATOR_TITLE);
+
+ qInfo() << "* Qt version (compile time):" << QT_VERSION_STR;
+ qInfo() << "* Qt version (runtime):" << qVersion();
+ qInfo() << "* working path:" << QDir::currentPath();
+ qInfo() << "* binary path:" << QCoreApplication::applicationDirPath();
+ qInfo() << "* Qt plugin library path:" << QCoreApplication::libraryPaths();
}
void qt5_prepare(void)