summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorJoona <joonatoona@digitalfishfun.com>2017-08-22 18:02:03 -0700
committerJoona <joonatoona@digitalfishfun.com>2017-08-22 18:02:03 -0700
commit60d10201e9bc349b2d803a0efa3f81d444cc136c (patch)
treef9c98276dc071298fe03fdf20c11e4a3a79ffd99 /api/logic
parent0cd55d943e5e64eb3f10e9a1a410bd90a925c2f7 (diff)
downloadMultiMC-60d10201e9bc349b2d803a0efa3f81d444cc136c.tar
MultiMC-60d10201e9bc349b2d803a0efa3f81d444cc136c.tar.gz
MultiMC-60d10201e9bc349b2d803a0efa3f81d444cc136c.tar.lz
MultiMC-60d10201e9bc349b2d803a0efa3f81d444cc136c.tar.xz
MultiMC-60d10201e9bc349b2d803a0efa3f81d444cc136c.zip
NOISSUE Add GPU vendor and driver version
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/minecraft/launch/PrintInstanceInfo.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/api/logic/minecraft/launch/PrintInstanceInfo.cpp b/api/logic/minecraft/launch/PrintInstanceInfo.cpp
index da204c1b..5f25970d 100644
--- a/api/logic/minecraft/launch/PrintInstanceInfo.cpp
+++ b/api/logic/minecraft/launch/PrintInstanceInfo.cpp
@@ -38,17 +38,39 @@ void PrintInstanceInfo::executeTask()
}
char buff[512];
- FILE *fp = popen("lspci", "r");
+ int gpuline = -1;
+ int cline = 0;
+ FILE *fp = popen("lspci -k", "r");
while (fgets(buff, 512, fp) != NULL)
{
std::string str(buff);
if (str.substr(8, 3) == "VGA")
{
+ gpuline = cline;
QStringList glines = (QStringList() << QString::fromStdString(str.substr(35, std::string::npos)));
logLines(glines, MessageLevel::MultiMC);
}
+ if (gpuline > -1 && gpuline != cline)
+ {
+ if (cline - gpuline < 3)
+ {
+ QStringList alines = (QStringList() << QString::fromStdString(str.substr(1, std::string::npos)));
+ logLines(alines, MessageLevel::MultiMC);
+ }
+ }
+ cline++;
}
+ FILE *fp2 = popen("glxinfo", "r");
+ while (fgets(buff, 512, fp2) != NULL)
+ {
+ if (strncmp(buff, "OpenGL version string:", 22) == 0)
+ {
+ QStringList drlines = (QStringList() << QString::fromUtf8(buff));
+ logLines(drlines, MessageLevel::MultiMC);
+ break;
+ }
+ }
#endif
logLines(lines, MessageLevel::MultiMC);