| Microsoft DirectX 8.1 (C++) | 
The following code example shows how to use the IDirect3DDevice8::GetDepthStencilSurfacemethod to retrieve a pointer to the depth-buffer surface owned by the device.
    LPDIRECT3DSURFACE8 pZBuffer;
    m_d3dDevice->GetDepthStencilSurface( &pZBuffer );