Export (0) Print
Expand All

GraphicsAdapter.CheckDeviceFormatConversion Method

Tests a device to determine whether it supports conversion from one display format to another.

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

public bool CheckDeviceFormatConversion (
         DeviceType deviceType,
         SurfaceFormat sourceFormat,
         SurfaceFormat targetFormat
)

Parameters

deviceType
Type of device to check.
sourceFormat
Source adapter format.
targetFormat
Target adapter format.

Return Value

true if the method succeeds; false if it fails.

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

Using CheckDeviceFormatConversion to test for compatibility between a back buffer and the display format returns appropriate values. This means that the call reflects device capabilities. If the device cannot render to the requested back buffer format, the call still returns false. If the device can render to the format but cannot perform the color-converting presentation, the return value is also false. Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself is offered.

Color conversion is restricted to certain source and target formats. The source format must be a four-character code (FOURCC) format or a valid back-buffer format, and the target format must be one of the following unsigned formats.

SurfaceFormat.Bgr555SurfaceFormat.Bgra5551SurfaceFormat.Bgr565
SurfaceFormat.Bgr24SurfaceFormat.Bgr32SurfaceFormat.Color
SurfaceFormat.Bgra1010102SurfaceFormat.Rgba64SurfaceFormat.Rgba1010102
SurfaceFormat.Rgba32SurfaceFormat.Rgb32SurfaceFormat.HalfVector4
SurfaceFormat.Vector4  

Xbox 360, Windows XP SP2, Windows Vista

Show:
© 2014 Microsoft