Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.CreateDepthStencilSurface

Creates a depth-stencil resource.

object.CreateDepthStencilSurface( _ 
    Width As Long, _ 
    Height As Long, _ 
    Format As CONST_D3DFORMAT, _ 
    MultiSample As CONST_D3DMULTISAMPLE_TYPE, _ 
    Surface As Direct3DSurface8)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Width
Width of the depth-stencil surface, in pixels.
Height
Height of the depth-stencil surface, in pixels.
Format
Member of the CONST_D3DFORMAT enumeration, describing the format of the depth-stencil surface. This value must be one of the enumerated depth-stencil formats for this device.
MultiSample
Member of the CONST_D3DMULTISAMPLE_TYPE enumeration, describing the multisampling buffer type. This value must be one of the allowed multisample types. When this surface is passed to SetRenderTarget, its multisample type must be the same as that of the render target.
Surface
A Direct3DSurface8 object, representing the created depth-stencil surface resource.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

The memory class of the depth-stencil buffer is always D3DPOOL_DEFAULT.

See Also

Direct3DDevice8.CopyRects, Direct3DDevice8.SetRenderTarget