如何打印出 GPU 的 OpenGl 版本并将其放入 Opengl 和 C++ 中的字符串中?
How print out the OpenGl version of a GPU and put it in a string in Opengl and C++?
我需要在应用程序中打印出我的 GPU 的 OpenGL 版本,然后将其放入字符串中。
您可以使用以下代码作为示例:
std::cout << "" << std::endl;
std::cout << "" << "OpenGL Vendor: " << glGetString(GL_VENDOR) << std::endl;
std::cout << "" << "OpenGL Renderer: " << glGetString(GL_RENDERER) << std::endl;
std::cout << "" << "OpenGL Version: " << glGetString(GL_VERSION) << std::endl;
std::cout << "" << "OpenGL Shading Language Version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;
std::cout << "" << std::endl;
std::string Vendor(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
std::string Renderer(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
std::string Version(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
std::string ShadingLanguageVersion(reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
mystring = "\n";
mystring = "OpenGL Vendor: " + Vendor + "\n";
mystring = "OpenGL Renderer : " + Renderer + "\n";
mystring = "OpenGL Version: " + Version + "\n";
mystring = "OpenGL Shading Language Version: " + ShadingLanguageVersion + "\n";
mystring = "\n";
我还推荐 this 文档。
我需要在应用程序中打印出我的 GPU 的 OpenGL 版本,然后将其放入字符串中。
您可以使用以下代码作为示例:
std::cout << "" << std::endl;
std::cout << "" << "OpenGL Vendor: " << glGetString(GL_VENDOR) << std::endl;
std::cout << "" << "OpenGL Renderer: " << glGetString(GL_RENDERER) << std::endl;
std::cout << "" << "OpenGL Version: " << glGetString(GL_VERSION) << std::endl;
std::cout << "" << "OpenGL Shading Language Version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << std::endl;
std::cout << "" << std::endl;
std::string Vendor(reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
std::string Renderer(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
std::string Version(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
std::string ShadingLanguageVersion(reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
mystring = "\n";
mystring = "OpenGL Vendor: " + Vendor + "\n";
mystring = "OpenGL Renderer : " + Renderer + "\n";
mystring = "OpenGL Version: " + Version + "\n";
mystring = "OpenGL Shading Language Version: " + ShadingLanguageVersion + "\n";
mystring = "\n";
我还推荐 this 文档。