Stefan Dösinger : wined3d: Disable the depth test in UnlockRect

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 26 13:55:11 CDT 2006


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri May 26 12:17:21 2006 +0200

wined3d: Disable the depth test in UnlockRect

---

 dlls/wined3d/surface.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1eebb66..c21e715 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -746,6 +746,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Unloc
         if (iface ==  implSwapChain->backBuffer || iface ==  implSwapChain->frontBuffer || iface == myDevice->renderTarget) {
             GLint  prev_store;
             GLint  prev_draw;
+            GLint  prev_depth_test;
             GLint  prev_rasterpos[4];
 
             /* Some drivers(radeon dri, others?) don't like exceptions during
@@ -776,6 +777,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Unloc
             vcheckGLcall("glIntegerv");
             glPixelZoom(1.0, -1.0);
             vcheckGLcall("glPixelZoom");
+            prev_depth_test = glIsEnabled(GL_DEPTH_TEST);
 
             /* glDrawPixels transforms the raster position as though it was a vertex -
                we want to draw at screen position 0,0 - Set up ortho (rhw) mode as
@@ -796,6 +798,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Unloc
 
             /* And back buffers are not blended */
             glDisable(GL_BLEND);
+            glDisable(GL_DEPTH_TEST);
 
             glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1);
             vcheckGLcall("glRasterPos2f");
@@ -897,6 +900,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_Unloc
             vcheckGLcall("glDrawBuffer");
             glRasterPos3iv(&prev_rasterpos[0]);
             vcheckGLcall("glRasterPos3iv");
+            if(prev_depth_test) glEnable(GL_DEPTH_TEST);
 
             /* Reset to previous pack row length / blending state */
             glPixelStorei(GL_UNPACK_ROW_LENGTH, skipBytes);




More information about the wine-cvs mailing list