c++ - 检查是否支持 DirectX 或 OpenGL

标签 c++ windows opengl directx

我想检查当前 Windows 系统(当然是运行时)是否支持具体的 DirectX 版本(例如 DirectX 9)或具体的 OpenGL 版本。

最佳答案

OpenGL 和 DirectX 存在于所有 Windows 系统中。但是执行特定扩展或使用功能的能力取决于硬件。您可以查询特定功能并使用这些功能。它因一台机器而异。

您可以使用 GetDeviceCaps 函数和其他相关的 Direct3D API 获取 Direct 中的设备参数。请看样本。 http://www.codesampler.com/dx9src/dx9src_1.htm#dx9_initialization

您可以使用 glGetString 了解设备功能。 http://www.codesampler.com/oglsrc/oglsrc_1.htm#ogl_initialization

关于c++ - 检查是否支持 DirectX 或 OpenGL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7013176/

相关文章:

python - 在 cython 中返回 C++ 对象(最好不是指针)

c++ - 可以将不同类型的对象放在一个数组中吗?

windows - 与 x86_64 Windows 调用约定混淆

python - 使用 Python Windows Launcher 时,有什么方法可以避免输入完整路径吗?

c - 无法使用具有 n 大小块的 Windows 文件映射顺序处理大于 250kb 的文件

OpenGL 窗口系统屏幕撕裂预防

opengl - OpenGL 和 GLSL 中的 glTexParameter 和过滤?

c++ - 来自多个线程的 COM 调用

c++ - 对数字进行分组 C++

java - 在 Opengl 中使用 theta 和 phi 角度进行旋转