diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index eba0f11426..132c6f6218 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -66,6 +66,7 @@ #include "CommandPy.h" #include "Control.h" #include "PreferencePages/DlgSettingsCacheDirectory.h" +#include "DlgCheckableMessageBox.h" #include "DocumentPy.h" #include "DocumentRecovery.h" #include "EditorView.h" @@ -2192,6 +2193,25 @@ void Application::runApplication() int major = context.format().majorVersion(); int minor = context.format().minorVersion(); + +#ifdef NDEBUG + // In release mode, issue a warning to users that their version of OpenGL is + // potentially going to cause problems + if (major < 2) { + auto message = + QObject::tr("This system is running OpenGL %1.%2. " + "FreeCAD requires OpenGL 2.0 or above. " + "Please upgrade your graphics driver and/or card as required.") + .arg(major) + .arg(minor) + + QStringLiteral("\n"); + Base::Console().Warning(message.toStdString().c_str()); + Dialog::DlgCheckableMessageBox::showMessage( + Gui::GUISingleApplication::applicationName() + QStringLiteral(" - ") + + QObject::tr("Invalid OpenGL Version"), + message); + } +#endif const char* glVersion = reinterpret_cast(glGetString(GL_VERSION)); Base::Console().Log("OpenGL version is: %d.%d (%s)\n", major, minor, glVersion); }