>> So when you get D3DERR_DEVICENOTRESET meaning the device can now be reset, call InitD3D() to re-init the device and don't forget you don't have to re-register the class or re-create the window
Okay. What is InitD3D, what class, and what window? I try to cope with a lost device something like:
Code:
HRESULT coop = mpd3dDevice->TestCooperativeLevel();
switch(coop)
{
case D3DERR_DEVICELOST:
return;
case D3DERR_DEVICENOTRESET:
// Release resources
if( FAILED( mpd3dDevice->Reset( &md3dpp ) ) )
{
OutputDebugString( TEXT( "Reset failed" ) );
return 0;
}
// Get 'em back
break;
default:;
}
When you say InitD3D, it sounds like some custom routine to reset the device. True?
When you say the class, are you talking about the window class? Was it unregistered?
When you say the window, are you talking about like, the hwnd window window?