Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Feb 18, 2022
2 parents 337a8a2 + 42103a1 commit f1ad28e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,23 +366,23 @@ static void initGui(GuiApplication* guiApp)
if (!guiApp)
return;

// Retrieve OpenGL infos
const std::string strGlVersion = queryGlVersionString();
const QVersionNumber glVersion = parseSemanticVersionString(strGlVersion);
qInfo() << fmt::format("OpenGL v{}.{}", glVersion.majorVersion(), glVersion.minorVersion()).c_str();

// Fallback for OpenGL
setFunctionCreateGraphicsDriver(&QWidgetOccView::createCompatibleGraphicsDriver);
IWidgetOccView::setCreator(&QWidgetOccView::create);

// Use QOpenGLWidget if possible
#if OCC_VERSION_HEX >= 0x070600
if (!glVersion.isNull() && glVersion.majorVersion() >= 2) { // Requires at least OpenGL version >= 2.0
setFunctionCreateGraphicsDriver(&QOpenGLWidgetOccView::createCompatibleGraphicsDriver);
IWidgetOccView::setCreator(&QOpenGLWidgetOccView::create);
}
else {
qWarning() << "Can't use QOpenGLWidget because OpenGL version is too old";
if (qobject_cast<QGuiApplication*>(QCoreApplication::instance())) { // QOpenGL requires QGuiApplication
const std::string strGlVersion = queryGlVersionString();
const QVersionNumber glVersion = parseSemanticVersionString(strGlVersion);
qInfo() << fmt::format("OpenGL v{}.{}", glVersion.majorVersion(), glVersion.minorVersion()).c_str();
if (!glVersion.isNull() && glVersion.majorVersion() >= 2) { // Requires at least OpenGL version >= 2.0
setFunctionCreateGraphicsDriver(&QOpenGLWidgetOccView::createCompatibleGraphicsDriver);
IWidgetOccView::setCreator(&QOpenGLWidgetOccView::create);
}
else {
qWarning() << "Can't use QOpenGLWidget because OpenGL version is too old";
}
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion version.pri
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defined(HAVE_GIT, var) {

MAYO_VERSION_MAJ = 0
MAYO_VERSION_MIN = 5
MAYO_VERSION_PAT = 0
MAYO_VERSION_PAT = 1
VERSION = $${MAYO_VERSION_MAJ}.$${MAYO_VERSION_MIN}.$${MAYO_VERSION_PAT}.$${MAYO_VERSION_REVNUM}
MAYO_VERSION = $${VERSION}-$$MAYO_VERSION_COMMIT

Expand Down

0 comments on commit f1ad28e

Please sign in to comment.