+static void checkOpenGLVersion()
+{
+#if defined(SG_MAC)
+ // Mac users can't upgrade their drivers, so complaining about
+ // versions doesn't help them much
+ return;
+#endif
+
+ // format of these strings is not standardised, so be careful about
+ // parsing them.
+ std::string versionString(fgGetString("/sim/rendering/gl-version"));
+ string_list parts = simgear::strutils::split(versionString);
+ if (parts.size() == 3) {
+ if (parts[1].find("NVIDIA") != std::string::npos) {
+ // driver version number, dot-seperared
+ string_list driverVersion = simgear::strutils::split(parts[2], ".");
+ if (!driverVersion.empty()) {
+ int majorDriverVersion = simgear::strutils::to_int(driverVersion[0]);
+ if (majorDriverVersion < 300) {
+ std::ostringstream ss;
+ ss << "Please upgrade to at least version 300 of the nVidia drivers (installed version is " << parts[2] << ")";
+
+ flightgear::modalMessageBox("Outdated graphics drivers",
+ "FlightGear has detected outdated drivers for your graphics card.",
+ ss.str());
+ }
+ }
+ } // of NVIDIA-style version string
+ } // of three parts
+}
+