【问题标题】:How to check whether the user is using NVIDIA or AMD in C++如何在 C++ 中检查用户使用的是 NVIDIA 还是 AMD
【发布时间】:2018-08-04 02:03:51
【问题描述】:

我需要一种方法来检查这一点。我知道如何在 C# 中做到这一点:

https://stackoverflow.com/a/49349037/8978746

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

【问题讨论】:

    标签: windows c++-cli


    【解决方案1】:

    您可以使用 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。

    【讨论】:

      猜你喜欢
      • 2018-08-27
      • 2022-10-16
      • 1970-01-01
      • 2019-03-28
      • 1970-01-01
      • 1970-01-01
      • 2020-09-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多