Jump to content
  • Advertisement
Sign in to follow this  

Accessing the depth buffer in D3D

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So here I am, brand new to D3D (familiar with OGL), and I'm looking for a way to access the depth buffer. I have gotten this far: HRESULT hr = NULL; LPDIRECT3DSURFACE9 m_pDepthSurface = NULL; if(FAILED(hr = m_pD3DDevice->GetDepthStencilSurface(&m_pDepthSurface))) { return hr; } -->>>>> How do I get data out of m_pDepthSurface???? if(m_pDepthSurface) { m_pDepthSurface->Release(); m_pDepthSurface = NULL; } As you can see above, I'm definitely a noob, and I must just be missing something in the D3D reference. Anybody have any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Lock*() and Unlock*() for all buffers and surfaces in D3D.

To lock the backbuffer/depth buffer you might have to create the device with specific flags, I can't recall.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!