[PATCH] WineD3D: Beware of the frontbuffer coordinate system =

Stefan Doesinger stefan at codeweavers.com
Tue Jul 29 11:02:07 CDT 2008


difference=0A=
=0A=
---=0A=
 dlls/wined3d/surface.c |   12 ++++++++++++=0A=
 1 files changed, 12 insertions(+), 0 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c=0A=
index 2227243..c69d6ef 100644=0A=
--- a/dlls/wined3d/surface.c=0A=
+++ b/dlls/wined3d/surface.c=0A=
@@ -3354,6 +3354,18 @@ static HRESULT =
IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *=0A=
             TRACE("Drawing to %#x buffer\n", buffer);=0A=
             glDrawBuffer(buffer);=0A=
             checkGLcall("glDrawBuffer");=0A=
+=0A=
+            /* Front buffer coordinates are screen coordinates, while =
OpenGL coordinates are=0A=
+             * window relative. Also beware of the origin =
difference(top left vs bottom left)=0A=
+             */=0A=
+            if(buffer =3D=3D GL_FRONT) {=0A=
+                POINT offset =3D {0,0};=0A=
+                LEAVE_GL();=0A=
+                ClientToScreen(myDevice->ddraw_window, &offset);=0A=
+                rect.x1 -=3D offset.x; rect.x2 -=3Doffset.x;=0A=
+                rect.y1 -=3D offset.y; rect.y2 -=3Doffset.y;=0A=
+                ENTER_GL();=0A=
+            }=0A=
         }=0A=
 =0A=
         /* Bind the texture */=0A=
-- =0A=
1.5.4.5=0A=
=0A=

------=_NextPart_000_00D0_01C8F2F4.C02DACE0--




More information about the wine-patches mailing list