summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft')
-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);