From 46ada8c2642ce7f15ca8c3f4ab9140b32e1eafcf Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Thu, 2 Oct 2008 18:56:17 +0000 Subject: [PATCH] Fix. Restore depth stencil surface. --- panda/src/dxgsg9/dxTextureContext9.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/panda/src/dxgsg9/dxTextureContext9.cxx b/panda/src/dxgsg9/dxTextureContext9.cxx index c122f18cca..49a65fedc8 100755 --- a/panda/src/dxgsg9/dxTextureContext9.cxx +++ b/panda/src/dxgsg9/dxTextureContext9.cxx @@ -1706,14 +1706,12 @@ fill_d3d_texture_pixels(DXScreenData &scrn) { IDirect3DSurface9 *depth_stencil_surface; // turn off depth stencil when clearing texture if it exists + depth_stencil_surface = 0; if (device -> GetDepthStencilSurface (&depth_stencil_surface) == D3D_OK) { if (device -> SetDepthStencilSurface (NULL) == D3D_OK) { } } - else { - depth_stencil_surface = 0; - } if (device -> SetRenderTarget (0, surface) == D3D_OK) { DWORD flags; @@ -1727,6 +1725,7 @@ fill_d3d_texture_pixels(DXScreenData &scrn) { // restore depth stencil if (depth_stencil_surface) { + device -> SetDepthStencilSurface (depth_stencil_surface); depth_stencil_surface -> Release(); }