Jump to content
  • Advertisement
Sign in to follow this  
ryan20fun

Why Does IDirect3D9::CheckDeviceType Faile all of a sudden

This topic is 2603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All.
i have no idea why this code fails


IDirect3D9 *d3d;
HRESULT _result = S_OK;

if((d3d = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
d3d->Release();
else
{
_result = d3d->CheckDeviceType(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
D3DFMT_UNKNOWN,
D3DFMT_UNKNOWN,
TRUE);

if(FAILED(_result))
{
_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
}
}


it just suddenly stoped working, and i have no idea why.
i tried using the D3D Debug Runtime and it said that the format i tried was not supported, even though it said my Graphics Card Supported it 10 Minutes ago.
even though it says its not supported i set it to the format that was working, and you know what, it woked even though CheckDeviceType said it wont.

Any idea how to fix this ?
Thanks in Advance.

---edit---
cleaned up the code

Share this post


Link to post
Share on other sites
Advertisement
this is more of a bushwaked verison of what i used, the code i use is in a dll and i dont want to recompile for simple checks.
but my point is that CheckDeviceType says that D3DFMT_UNKOWN is not supported, as well as D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 and D3DFMT_R5G6B5

Share this post


Link to post
Share on other sites
I dunno, but don't call ->Release() on your d3d object if Direct3DCreate9() returns NULL would be one thing i'd change for the future anyway

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!