Win32:如何确定 DirectDraw 是否启用?
使用 CachedBitmaps
在 GDIPlus 中,如果 Windows 视频“硬件加速”降低太多,则会出现图形损坏 - 例如禁用 DirectDraw:
有六级硬件加速:
- 禁用所有加速
- 禁用除基本加速之外的所有加速。 (服务器 计算机上的默认设置)
- 禁用所有 DirectDraw 和 Direct3D 加速,以及所有光标和高级绘图加速
- 禁用所有光标和高级绘图加速
- 禁用光标和位图加速
- 所有加速均已启用( 上的默认设置台式机)
如果禁用 DirectDraw,则在 GDI+ 中使用 DrawCachedBitmap
将导致图形损坏。对我来说使用较慢的 DrawImage 很容易()
API(如果未启用 DirectDraw) - 但我必须能够检测 DirectDraw 已禁用。
如何以编程方式检查 DirectDraw 是否已启用?
问题是: dxdiag 如何执行此操作:
另请参阅
When using CachedBitmaps
in GDIPlus, there is graphical corruption if Windows video "Hardware Acceleration" is lowered too much - such that DirectDraw is disabled:
There are six levels of hardware acceleration:
- Disable all accelerations
- Disable all but basic accelerations. (Default on server machines)
- Disable all DirectDraw and Direct3D accelerations, as well as all cursor and advanced accelerations
- Disable all cursor and advanced drawing accelerations
- Disable cursor and bitmap accelerations
- All accelerations are enabled (Default on desktop machines)
If DirectDraw is disabled, then using DrawCachedBitmap
in GDI+ will result in graphical corruption. It's easy enough for me to use the slower DrawImage()
API if DirectDraw is not enabled - but i have to be able to detect that DirectDraw is disabled.
How can i programatically check if DirectDraw is enabled?
The question is: How does dxdiag do this:
See also
KB191660 - DirectDraw or Direct3D option is unavailable (archive)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您下载最新的 DirectX SDK (我确信旧的 sdk 有类似的示例)有一个查询 DXDIAG 信息的示例。
该示例位于 (SDK Root)\Samples\C++\Misc\DxDiagReport
在 dxdiaginfo.cpp 中值得注意的方法
如果运行该程序,它会输出一个巨大的值列表。我认为您感兴趣的值是
pDisplayInfo->m_szDDStatusEnglish
If you download the latest DirectX SDK (I'm sure older sdk's have similar examples) there is an example of querying DXDIAG info.
The example is located at (SDK Root)\Samples\C++\Misc\DxDiagReport
In dxdiaginfo.cpp methods of note
If you run the program it ouputs a giant list of values. I think the value you're interested in is
pDisplayInfo->m_szDDStatusEnglish
您可以检查注册表中的加速度滑块值。
您可能需要循环浏览
Video
中的所有文件夹,因为通常有多个条目。Acceleration.Level 值
更新:
这是一个有关以编程方式更改/检查加速级别的旧线程。
http://www.autoitscript.com/forum/topic/61185-hardware-加速度/
You could check the registry for the acceleration slider value.
You're probably going to have to loop through all the folders in
Video
as there are generally more than one entry.Acceleration.Level Values
Update:
Here's an older thread about programatically changing/checking the acceleration level.
http://www.autoitscript.com/forum/topic/61185-hardware-acceleration/
您可以查询 IDirectDraw 接口,看看有什么确实如此。我认为如果硬件加速关闭,它将失败,但您可能想测试 GetCaps() 或 TestCooperativeLevel()。
不幸的是,DirectDraw 文档不再包含在 SDK 中。您可能需要旧版本才能获取示例和头文件。
You could query a IDirectDraw interface and see what it does. I assume it will fail if hardware acceleration is turned off, but you might want to test GetCaps() or TestCooperativeLevel().
Unfortunately the DirectDraw docs are no longer included in the SDKs. You might need an older version to get the samples and header files.