c++ - 如何在一台 PC 上的不同 OpenGL 版本上测试我的 OpenGL 代码?

标签 c++ windows opengl

有没有办法在一台 PC 上的不同 OpenGL 版本上测试我的 OpenGL 代码?

例如,任何虚拟机,我可以在其中选择我想要的 OpenGL 版本?

我想检查我的应用程序如何与 OpenGL 2.0、3.0、3.3、4.0 和 4.5+ 配合使用。 我当前的显卡支持最新的 OpenGL 版本。

最佳答案

针对 Mesa's software renderer 运行您的程序并用 MESA_GL_VERSION_OVERRIDE 进行实验环境变量:

changes the value returned by glGetString(GL_VERSION) and possibly the GL API type.

MESA_GLSL_VERSION_OVERRIDE 结合提供a matching GLSL 版本:

changes the value returned by glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as 130...

最后MESA_EXTENSION_MAX_YEAR可以限制公开哪些扩展:

The GL_EXTENSIONS string returned by Mesa is sorted by extension year. If this variable is set to year X, only extensions defined on or before year X will be reported.

关于c++ - 如何在一台 PC 上的不同 OpenGL 版本上测试我的 OpenGL 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/77007682/

相关文章:

c++ - 如何将Visual Studio宏值转换为预处理器指令?

c++ - 从 FloatingLiteral/APFloat 获取原始解析数字

linux - Windows 和 Linux 下路径名的语法分别是什么?

c++ - 读取 Windows 注册表时顺序是否重要?

python - 3d 立方体未正确显示 pyglet 写入

c++ - 如何检测以错误大小传递的空 C 数组?

c++ - 为什么不的unique_ptr在C++ 20 equality_comparable_with nullptr_t?

windows - 如何在 Windows 上创建和使用 Makefile?

linux - Linux 中的 Qt 线程问题

c++ - 向上和向左旋转相机