I spent rather a lot of time searching for the answer to this question, and eventually had to generate my own blend of solution. It works, so this is how I did it:
void win_app::render_scene(float elapsed_seconds)
{
if(dx.screen == NULL){
return;
}
static HRESULT result;
result = dx.screen->TestCooperativeLevel();
switch(result){
case D3D_OK:
break;
case D3DERR_DEVICELOST:
return;
case D3DERR_DEVICENOTRESET:
dx.reset(main_window);
return;
case D3DERR_DRIVERINTERNALERROR:
return;
}
// render code
The dx.screen object is a LPDIRECT3DDEVICE9. Code in the dx.reset(HWND)
void d3d_class::reset(HWND window)
{
screen->Reset(&screen_parameters);
};
Any comments? Anything I'm missing?
[Edited by - AngleWyrm on June 8, 2007 2:53:03 PM]
--"I'm not at home right now, but" = lights on, but no ones home