How to Detect Hardware Acceleration for OpenGL on Windows

笑着哭i 提交于 2020-03-22 06:50:48

问题


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.


回答1:


From the FAQ: How do I know my program is using hardware acceleration on a Wintel card?

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.




回答2:


Or you can interrogate the device's capability with Direct3D, if you're on Windows. The "standard" GDI Win32 GetDeviceCaps() call doesn't deal with 3D...



来源:https://stackoverflow.com/questions/1122730/how-to-detect-hardware-acceleration-for-opengl-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!