Win32: set viewport on device reset, clear image before image size changes

This commit is contained in:
OV2 2011-04-30 01:26:42 +02:00
parent 13e8c2dc34
commit 1482cae24d
1 changed files with 7 additions and 7 deletions

View File

@ -293,8 +293,6 @@ bool CDirect3D::Initialize(HWND hWnd)
init_done = true;
SetViewport();
ApplyDisplayChanges();
return true;
@ -730,6 +728,9 @@ void CDirect3D::Render(SSurface Src)
drawSurface->UnlockRect(0);
}
if(!GUI.Stretch||GUI.AspectRatio)
pDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
//if the output size of the render method changes we need to update the viewport
if(afterRenderHeight != dstRect.bottom || afterRenderWidth != dstRect.right) {
afterRenderHeight = dstRect.bottom;
@ -737,9 +738,6 @@ void CDirect3D::Render(SSurface Src)
SetViewport();
}
if(!GUI.Stretch||GUI.AspectRatio)
pDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
pDevice->BeginScene();
pDevice->SetTexture(0, drawSurface);
@ -926,7 +924,6 @@ bool CDirect3D::ChangeRenderSize(unsigned int newWidth, unsigned int newHeight)
if(!ResetDevice())
return false;
SetViewport();
return true;
}
@ -999,6 +996,9 @@ bool CDirect3D::ResetDevice()
//recreate the surface
CreateDrawSurface();
SetViewport();
return true;
}
@ -1041,7 +1041,7 @@ bool CDirect3D::SetFullscreen(bool fullscreen)
//present here to get a fullscreen blank even if no rendering is done
pDevice->Present(NULL,NULL,NULL,NULL);
SetupVertices();
return true;
}