This project has moved and is read-only. For the latest updates, please go here.

Problem in win32 DirectX game template

Jan 12, 2016 at 2:56 PM
Hi I dont know where to report this problem so I will do it here.
I found a problem with depth stencil in win32 DirectX game template, the depth stencil is created in local variable and it's never assigned to m_depthStencil member

ComPtr<ID3D11Texture2D> depthStencil; DX::ThrowIfFailed(m_d3dDevice
->CreateTexture2D(&depthStencilDesc, nullptr, depthStencil.GetAddressOf()));
Jan 12, 2016 at 7:01 PM
Edited Jan 12, 2016 at 7:04 PM
Thanks for the report.

I'm tempted to just remove the m_depthStencil variable from the Game.h file (and remove the reference to it in OnDeviceLost) since you only need the m_depthStencilView in most cases (Clear, Render only need the DSV). The Direct3D 11 DeviceResources abstraction in the Windows Store template only keeps the DSV rather than the DS object.

Is there some use-case for needing the m_depthStencil itself for the Direct3D 11 templates?

PS: You can also report issues with the templates on GitHub.
Jan 12, 2016 at 7:53 PM
Edited Jan 12, 2016 at 7:54 PM
Nah there is no particular reason for me to use it I'm using templates as reference and I've noticed that this member has no value assigned so I thought I will report that
Jan 16, 2016 at 7:12 AM
Thanks again. Fixed in the latest release on GitHub.
Marked as answer by walbourn on 1/15/2016 at 11:12 PM