Dela via


StateBlock Constructor

Initializes a new instance of the StateBlock class.

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

Syntax

public StateBlock (
         GraphicsDevice graphicsDevice
)

Parameters

  • graphicsDevice
    The device to associate with the state block.

Exceptions

Exception type Condition
ArgumentNullException graphicsDevice is null.
InvalidOperationException Unable to create this StateBlock resource on the graphics device.

Remarks

StateBlock objects must be recreated when the device is reset.

See Also

Tasks

How to: Load Resources

Reference

GraphicsDeviceManager.DeviceReset Event
StateBlock Class
StateBlock Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista