如何在Windows上检测OpenGL的硬件加速

问题描述:

是否有Win32 API调用来检测用户系统的当前硬件加速级别?我不需要更改设置,但是如果禁用了硬件加速,我想缩小我的OpenGL显示的细节级别.

Is there a Win32 API call that detects the current Hardware Acceleration level of a user's system? I have no need to change the setting, but I'd like to scale back the level of detail for my OpenGL display if hardware acceleration is disabled.

来自FAQ:我怎么知道我的程序正在Wintel卡上使用硬件加速?

如果使用的是Win32接口(而不是GLUT),请致电 DescribePixelFormat()并检查 返回dwFlags位域.如果 PFD_GENERIC_ACCELERATED清晰且 设置PFD_GENERIC_FORMAT,然后 像素格式仅受 通用实现.硬件 为此无法加速 格式.为了硬件加速,您 需要选择其他格式.

If you are using the Win32 interface (as opposed to GLUT), call DescribePixelFormat() and check the returned dwFlags bitfield. If PFD_GENERIC_ACCELERATED is clear and PFD_GENERIC_FORMAT is set, then the pixel format is only supported by the generic implementation. Hardware acceleration is not possible for this format. For hardware acceleration, you need to choose a different format.