|
???-D3D?????alt tab???????????????????????
??????????????render????
TestCooperativeLevel() = D3DERR_DEVICELOST
??
pDevice->Reset( &d3dpp ) )??????
?????????+????
?pDevice->Reset( &d3dpp ) )?FAILED?
???????????????
HRESULT hr;
if (bLostDevice)
{
if( FAILED( hr=pDevice->TestCooperativeLevel() ) )
{
if( hr==D3DERR_DEVICENOTRESET )
{
// ???????
if (FAILED(pDevice->Reset( &d3dpp ) ))
MessageBox(pmywin->hWnd,"reset failed",NULL,NULL);
}
bLostDevice = FALSE;
}
}
hr = pDevice->TestCooperativeLevel();
// hr = pDevice-> resent( NULL, NULL, NULL, NULL );
if( hr==D3DERR_DEVICELOST)
{
bLostDevice = TRUE;
}
return TRUE;
|
|