Added support to detect version numbers on nvidia.

This commit is contained in:
hiker
2014-12-02 17:11:29 +11:00
parent 24e850db79
commit 3ba2470619

View File

@@ -84,7 +84,9 @@ public:
Version(const std::string &driver_version, const std::string &card_name)
{
m_version.clear();
// Intel card: driver version = "3.1.0 - Build 9.17.10.3517"
// ---------------------------------------------------------
if (StringUtils::startsWith(card_name, "Intel"))
{
std::vector<std::string> s = StringUtils::split(driver_version, '-');
@@ -95,6 +97,19 @@ public:
}
}
// Nvidia: driver_version = "4.3.0 NVIDIA 340.58"
// ----------------------------------------------
if (driver_version.find("NVIDIA") != std::string::npos)
{
std::vector<std::string> s = StringUtils::split(driver_version, ' ');
if (s.size() == 3)
{
convertVersionString(s[2]);
return;
}
}
Log::warn("Graphics", "Can not find version for '%s' '%s' - ignored.",
driver_version.c_str(), card_name.c_str());