fixed no image after multi-tasking from full screen

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@128 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2007-12-01 14:41:48 +00:00
parent a4a2f0a3a3
commit 655a149f2b
1 changed files with 18 additions and 2 deletions

View File

@ -447,14 +447,30 @@ void Direct3DDisplay::render()
{
if( failed ) return;
if(!pDevice) return;
if( FAILED( pDevice->TestCooperativeLevel() ) ) return;
// Multi-Tasking fix
HRESULT hr = pDevice->TestCooperativeLevel();
if( FAILED( hr ) ) {
switch( hr ) {
case D3DERR_DEVICELOST:
// The device has been lost but cannot be reset at this time.
// Therefore, rendering is not possible.
return;
case D3DERR_DEVICENOTRESET:
// The device has been lost but can be reset at this time.
resetDevice();
return;
default:
DXTRACE_ERR( _T("ERROR: D3D device has serious problems"), hr );
return;
}
}
clear();
pDevice->BeginScene();
// copy pix to emulatedImage and apply pixel filter if selected
HRESULT hr;
D3DLOCKED_RECT lr;
if( FAILED( hr = emulatedImage->LockRect( 0, &lr, NULL, D3DLOCK_DISCARD ) ) ) {