如何在 C++ 中检查用户使用的是 NVIDIA 还是 AMD

How to check whether the user is using NVIDIA or AMD in C++

我需要一种方法来检查这个。我知道如何在 C# 中执行此操作:

但是我们如何在 C++ 中做到这一点?

您可以使用 OpenGL Api 的 glGetString(GL_VERSION) 方法来获取您需要的信息。 这是一个用法示例;

#include <stdio.h>
#include <GL/gl.h>
#include <GL/freeglut.h>
int main(int argc, char **argv)
{
 glutInit(&argc, argv); // creates opengl context
 glutInitContextVersion(4, 4); // this is the version that works for me
 glutCreateWindow("Test");
 const GLubyte *vendor = glGetString( GL_VENDOR ); // returns the Vendor of Card
 const GLubyte *version = glGetString( GL_VERSION ); // returns the version of the Card
}

您可以阅读更多相关信息 here