From 1d4a4b75bc5e0747c87fe0e84feacdc3a533af5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 27 Mar 2007 17:41:25 +0200 Subject: [PATCH] ddraw: When changing the back buffers also update the render target. --- dlls/ddraw/device.c | 5 +++++ dlls/ddraw/direct3d.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 231e2cdf43c..2e260567dae 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -308,6 +308,11 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface) /* Restore the render targets */ if(This->OffScreenTarget) { + /* Set the device up to render to the front buffer since the back buffer will + * vanish soon. + */ + IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0, + This->ddraw->d3d_target->WineD3DSurface); /* This->target is the offscreen target. * This->ddraw->d3d_target is the target used by DDraw */ diff --git a/dlls/ddraw/direct3d.c b/dlls/ddraw/direct3d.c index b716a60755c..3047f1db69c 100644 --- a/dlls/ddraw/direct3d.c +++ b/dlls/ddraw/direct3d.c @@ -855,6 +855,10 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface, if(hr != D3D_OK) ERR("(%p) Error %08x setting the front and back buffer\n", This, hr); + /* Render to the back buffer */ + IWineD3DDevice_SetRenderTarget(This->wineD3DDevice, 0, + target->WineD3DSurface); + object->OffScreenTarget = TRUE; } else