Share via


GraphicsDevice.Reset Method

Resets the presentation parameters for the current GraphicsDevice.

Overload List

Name Description
GraphicsDevice.Reset () Resets the presentation parameters for the current GraphicsDevice.
GraphicsDevice.Reset (PresentationParameters) Resets the current GraphicsDevice with the specified PresentationParameters.
GraphicsDevice.Reset (PresentationParameters, GraphicsAdapter) Resets the specified Reset with the specified presentation parameters.

Exceptions

Exception type Condition
DeviceLostException The GraphicsDevice is lost but cannot be reset at this time. Therefore, rendering is not possible.
OutOfMemoryException Direct3D could not allocate sufficient memory to complete the call.

Remarks

When switching to full screen mode, Microsoft Direct3D tries to find a desktop format that matches the back buffer format, so that back and front buffer formats are identical. This eliminates the need for color conversion.

Calling Reset causes all texture memory surfaces and state information to be lost, and managed textures to be flushed from video memory. Before calling Reset for a GraphicsDevice, an application should release any explicit render targets, depth stencil surfaces, additional swap chains, and default resources associated with the GraphicsDevice.

Swap chains are either full screen or windowed. If the new swap chain is full screen, the adapter is placed in the display mode that matches the new size.

A call to Reset fails if made on a different thread than the one used to create the GraphicsDevice being reset.

Pixel shaders and vertex shaders survive Reset calls for DirectX 9.0. They do not need to be re-created explicitly by the application.

Unknown can be specified for the windowed-mode back-buffer format when creating a GraphicsDevice and Reset. This means the application does not have to query the current desktop format before calling a GraphicsDevice constructor for windowed mode. For full screen mode, the back-buffer format must be specified.

When trying to reset more than one display adapter in a group, pass in an array of PresentationParameters objects, one for each display in the adapter group.

See Also

Reference

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