IDirect3D9 :: CheckDeviceType接缝将被破坏 [英] IDirect3D9::CheckDeviceType seams to be broken

查看:107
本文介绍了IDirect3D9 :: CheckDeviceType接缝将被破坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
不管我给它什么字体,即使D3DFMT_UNKOWN,IDirect3D9 :: CheckDeviceType都会突然失败.
即使它说不支持,我也会将其设置为我给它的格式,然后它就会起作用.

有人知道如何解决这个问题吗?
提前致谢

---编辑---
我尝试使用较旧版本的解决方案(感谢上帝,我保留了我的项目的至少3个备份)
并且它看起来可以正常工作,将要查看我是否可以重现该问题,以便我知道该怎么做.
任何人都有类似的东西?,修改某些东西,然后将其破坏,不做任何修改即可还原到版本,效果很好.

Hi All.
all of a sudden IDirect3D9::CheckDeviceType fails no matter what fomrat i give to it, even D3DFMT_UNKOWN.
even if it says not supported, i set it to the format i gave to it aand it works.

anybody know how to fix this?
Many Thanks in Advance

---edit---
i tried using a slightly older version of my solution (thank god i keep atleast 3 backups of my project)
and it seams to work fine, going to see if i can reproduce the problem so i know what not to do.
anybody had something similar ?, modify something and it breaks it, revert to version without modification and it works great.

推荐答案

就像一个实验,尝试使用:
Just as an experiment try using:
CheckDeviceType( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, false );



参考设备就是它所说的,它的行为应与完全兼容DirectX的图形卡完全相同.如果CheckDeviceType在参考设备上运行正常,但在硬件设备上运行失败,则可能是您的驱动程序有问题.

如果参考设备有效,则为消除其他可能性,您还可以确保对Display和BackBuffer格式使用相同的格式,还可以获取当前的显示格式(由于已经设置,因此可以使用) )像这样:



The reference device is just what it says it, it should behave exactly the same as a fully compliant DirectX compatible graphics card. If CheckDeviceType works fine on the Reference device, but fails on the hardware device then it''s possible you have some bad drivers.

If the reference device works, then to eliminate any other possibilities you can also make sure to use the same format for both the Display and BackBuffer formats, you can also get the current display format (guaranteed to work, since it''s already set) like so:

D3DDISPLAYMODE dispMode;
m_Device->GetAdapterDisplayMode(0, &dispMode);
m_Device->CheckDeviceType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, dispMode.Format, dispMode.Format, false );



另外,我认为您只能在窗口模式下使用D3DFMT_UNKOWN(在这种情况下,它仅使用当前的显示格式),而我上面给出的示例将检查与全屏模式的兼容性,以帮助避免从您提供的显示格式转换为在Windows中显示格式.



Also I think you can only use D3DFMT_UNKOWN for windowed mode (in which case it just uses the current display format) and the examples I gave above check for compatibility with fullscreen mode to help avoid issues with converting from the display format you supply, to the display format in windows.


这篇关于IDirect3D9 :: CheckDeviceType接缝将被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆