Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Metus

IDirect3DDevice9::Reset() Bug

This topic is 5534 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

i''m converting my small d3d8 project to use d3d9 and found a little bug in the IDirect3DDevice9::Reset() function. the same function in d3d8 sent a WM_LOSTFOCUS when the device was lost, but NOT in d3d9, wich i find very frustrating. is it someone here who can confirm or deny the bug?

Share this post


Link to post
Share on other sites
Advertisement
Window messages are not a reliable way to test for lost device. Check the return value of Present(), or call TestCooperativeLevel().

xyzzy

Share this post


Link to post
Share on other sites
yes, that''s exactly what i''m doing:


m_Device3D->EndScene();
if(D3DERR_DEVICELOST == m_Device3D->Present(0, 0, 0, 0))
{
if(D3DERR_DEVICENOTRESET == m_Device3D->TestCooperativeLevel())
{
m_Device3D->Reset(&m_PresentParameters);
}
}


this code sends a WM_KILLFOCUS (when the window is minimized) in direct3d8, but NOT in direct3d9

Share this post


Link to post
Share on other sites
Do the 8.1/9 docs say the function had to send WM_KILLFOCUS? If not, then you shouldn''t be doing this anyway.

The docs contain what the function should do "by design". If you do anything that they didn''t have in mind for you, then you''re risking app failure when the behavior changes (in later versions, like 9).

If the docs say the function should send WM_KILLFOCUS, send a complaint to directx@microsoft.com

Cheers,
Muhammad Haggag

Share this post


Link to post
Share on other sites

  • 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!