Commit ad497a0e authored by Rogerborg's avatar Rogerborg

Release() and recreate the depth-stencil surface when resetting the D3D9...

Release() and recreate the depth-stencil surface when resetting the D3D9 driver. This surface is implicitly created with D3DPOOL_DEFAULT, so needs to be released or the reset fails.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1759 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0a1d6a89
...@@ -2301,6 +2301,10 @@ bool CD3D9Driver::reset() ...@@ -2301,6 +2301,10 @@ bool CD3D9Driver::reset()
tex->Release(); tex->Release();
} }
} }
if(DepthBuffers[0]->Surface)
DepthBuffers[0]->Surface->Release();
DriverWasReset=true; DriverWasReset=true;
HRESULT hr = pID3DDevice->Reset(&present); HRESULT hr = pID3DDevice->Reset(&present);
...@@ -2311,6 +2315,8 @@ bool CD3D9Driver::reset() ...@@ -2311,6 +2315,8 @@ bool CD3D9Driver::reset()
((CD3D9Texture*)(Textures[i].Surface))->createRenderTarget(); ((CD3D9Texture*)(Textures[i].Surface))->createRenderTarget();
} }
pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface));
if (FAILED(hr)) if (FAILED(hr))
{ {
if (hr == D3DERR_DEVICELOST) if (hr == D3DERR_DEVICELOST)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment