Stefan Dösinger : ddraw: When changing the back buffers also update the render target.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 29 14:43:30 CDT 2007


Module: wine
Branch: master
Commit: 1d4a4b75bc5e0747c87fe0e84feacdc3a533af5e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1d4a4b75bc5e0747c87fe0e84feacdc3a533af5e

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue Mar 27 17:41:25 2007 +0200

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(+), 0 deletions(-)

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 231e2cd..2e26056 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 b716a60..3047f1d 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




More information about the wine-cvs mailing list