Stefan Dösinger : wined3d: Implement IWineD3DSurface:: Flip.

Alexandre Julliard julliard at wine.codeweavers.com
Wed May 10 05:22:34 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: cd05f9c10c2f83c6d0be117b1827ed04be4619a9
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=cd05f9c10c2f83c6d0be117b1827ed04be4619a9

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Tue May  9 19:49:24 2006 +0200

wined3d: Implement IWineD3DSurface::Flip.

---

 dlls/wined3d/surface.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 497b22a..dbd9958 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1678,8 +1678,23 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetPB
 }
 
 HRESULT WINAPI IWineD3DSurfaceImpl_Flip(IWineD3DSurface *iface, IWineD3DSurface *override, DWORD Flags) {
-    FIXME("This is unimplemented for now(d3d7 merge)\n");
-    return WINED3DERR_INVALIDCALL;
+    IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
+    IWineD3DDevice *D3D = (IWineD3DDevice *) This->resource.wineD3DDevice;
+    TRACE("(%p)->(%p,%lx)\n", This, override, Flags);
+
+    /* Flipping is only supported on RenderTargets */
+    if( !(This->resource.usage & WINED3DUSAGE_RENDERTARGET) ) return DDERR_NOTFLIPPABLE;
+
+    if(override) {
+        /* DDraw sets this for the X11 surfaces, so don't confuse the user 
+         * FIXME("(%p) Target override is not supported by now\n", This);
+         * Additionally, it isn't really possible to support triple-buffering
+         * properly on opengl at all
+         */
+    }
+
+    /* Flipping a OpenGL surface -> Use WineD3DDevice::Present */
+    return IWineD3DDevice_Present(D3D, NULL, NULL, 0, NULL);
 }
 
 HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, RECT *DestRect, IWineD3DSurface *SrcSurface, RECT *SrcRect, DWORD Flags, DDBLTFX *DDBltFx) {




More information about the wine-cvs mailing list