From f5fbfe47d7b5e3667f43708d17eedd62219c3952 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 16 Oct 2008 11:52:54 +0200 Subject: [PATCH] wined3d: Handle offscreen rendering a bit nicer in surface_blt_to_drawable(). --- dlls/wined3d/surface.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 72f7537133a..9f0f5f92e7d 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4238,18 +4238,25 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT glTexParameteri(bind_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); checkGLcall("glTexParameteri"); + if (device->render_offscreen) + { + LONG tmp = rect.top; + rect.top = rect.bottom; + rect.bottom = tmp; + } + glBegin(GL_QUADS); glTexCoord3fv(&coords[0].x); - glVertex2i(rect.left, device->render_offscreen ? rect.bottom : rect.top); + glVertex2i(rect.left, rect.top); glTexCoord3fv(&coords[1].x); - glVertex2i(rect.left, device->render_offscreen ? rect.top : rect.bottom); + glVertex2i(rect.left, rect.bottom); glTexCoord3fv(&coords[2].x); - glVertex2i(rect.right, device->render_offscreen ? rect.top : rect.bottom); + glVertex2i(rect.right, rect.bottom); glTexCoord3fv(&coords[3].x); - glVertex2i(rect.right, device->render_offscreen ? rect.bottom : rect.top); + glVertex2i(rect.right, rect.top); glEnd(); checkGLcall("glEnd");