GraphicsAdapter.CheckDeviceFormat Method (DeviceType, SurfaceFormat, ResourceUsage, QueryUsages, ResourceType, SurfaceFormat)

Verifies whether a surface buffer format is available as a specified resource type and can be used as a texture, depth-stencil buffer, render target, or any combination of the three, on a device representing the current adapter.

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

public bool CheckDeviceFormat (
         DeviceType deviceType,
         SurfaceFormat adapterFormat,
         ResourceUsage usage,
         QueryUsages queryUsages,
         ResourceType resourceType,
         SurfaceFormat checkFormat


The type of device to check.
The format of the display mode into which the adapter will be placed.
A set of options identifying the behaviors of this surface resource.
The type of query to issue.
A resource type requested for use with the queried format.
The format of the surface identified by usage.

Return Value

true if the surface format is available as the specified resource and format type; false otherwise.

Exception typeCondition
DeviceNotSupportedException(Xbox 360) Hardware is the only device type supported on this platform.

Xbox 360, Windows XP SP2, Windows Vista