DepthStencilBuffer Constructor (GraphicsDevice, Int32, Int32, DepthFormat)

Initializes a new instance of the DepthStencilBuffer class.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public DepthStencilBuffer (
         GraphicsDevice graphicsDevice,
         int width,
         int height,
         DepthFormat format
)

Parameters

  • graphicsDevice
    The graphics device that will display the depth stencil buffer.
  • width
    Width, in pixels, of the depth stencil buffer.
  • height
    Height, in pixels, of the depth stencil buffer.
  • format
    The format of the data to be placed in this depth stencil buffer.

Exceptions

Exception type Condition
ArgumentNullException

graphicsDevice is null.

ArgumentOutOfRangeException width and height are less than or equal to zero. width and height must be greater than zero.
ArgumentException

One of the following conditions is true:

InvalidOperationException

Unable to create this DepthStencilBuffer resource.

See Also

Reference

DepthStencilBuffer Class
DepthStencilBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista