Archived

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

Metus

IDirect3DDevice9::Reset() Bug

Recommended Posts

Metus    168
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
xyzzy00    307
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
Metus    168
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
Muhammad Haggag    1358
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