Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 31-May-11 0:00am
v3

1 solution

Just as an experiment try using:
CheckDeviceType( D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, D3DFMT_X8R8G8B8, D3DFMT_X8R8G8B8, false );


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 );


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.
 
Share this answer
 
v2
Comments
Sandeep Mewara 30-May-11 14:10pm    
My 5!
ryan20fun 30-May-11 14:21pm    
nope, still failes, even with a Reference device.
but what i dont get is that it runs fine even though the call failes, i just made it show a messagebox to indicate success / failed.
and my graphics drivers appears to be fine, i tried resintalling the DX runtime but it changed nothing
Anthony Mushrow 30-May-11 19:53pm    
Yeah, it's pretty weird. I'm a little surprised the reference device failed though. My best guess is that the problem isn't with anything your doing, especially if it still actually works with the same settings.

It might be worth trying it on a different machine
ryan20fun 31-May-11 3:35am    
so what would you suggest to fix this ?
im going to try reinstalling my graphics drivers and if that fails, i dont know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900