| Microsoft DirectX 8.1 (Visual Basic) | 
The following code example shows how to use the Direct3DDevice8.GetDepthStencilSurface method to retrieve the depth buffer-surface owned by the device.
    Dim ZBuffer As Direct3DSurface8
    Set ZBuffer = d3dDevice.GetDepthStencilSurface