diff --git a/qt/qt_common/map_widget.cpp b/qt/qt_common/map_widget.cpp index a3c26c2549..e18a09eaf9 100644 --- a/qt/qt_common/map_widget.cpp +++ b/qt/qt_common/map_widget.cpp @@ -383,8 +383,21 @@ void MapWidget::initializeGL() else { LOG(LINFO, ("Contex is LibGL")); - // TODO: Separate apiOpenGL3 from apiOpenGLES3, and use that for the currend shader code. - m_apiOpenGLES3 = true; + GLint majorVersion = 0, minorVersion = 0; + funcs->glGetIntegerv(GL_MAJOR_VERSION, &majorVersion); + funcs->glGetIntegerv(GL_MINOR_VERSION, &minorVersion); + + if (majorVersion < 3 || (majorVersion == 3 && minorVersion < 2)) + { + LOG(LINFO, ("OpenGL version is below 3.2, taking the OpenGL 2.1 path")); + m_apiOpenGLES3 = false; + } + else + { + LOG(LINFO, ("OpenGL version is at least 3.2, enabling GLSL '#version 150 core'")); + // TODO: Separate apiOpenGL3 from apiOpenGLES3, and use that for the currend shader code. + m_apiOpenGLES3 = true; + } } auto fmt = context()->format();