Class GraphicsAdapter
Provides methods to retrieve and manipulate graphics adapters.
public sealed class GraphicsAdapter : IDisposable
- Inheritance
-
GraphicsAdapter
- Implements
- Inherited Members
Properties
Adapters
Gets a read-only collection of available adapters on the system.
public static ReadOnlyCollection<GraphicsAdapter> Adapters { get; }
Property Value
CurrentDisplayMode
Gets the current display mode.
public DisplayMode CurrentDisplayMode { get; }
Property Value
DefaultAdapter
Gets the default adapter.
public static GraphicsAdapter DefaultAdapter { get; }
Property Value
Description
Gets a string used for presentation to the user.
public string Description { get; }
Property Value
IsWideScreen
Gets a bool indicating whether CurrentDisplayMode has a Width:Height ratio corresponding to a widescreen DisplayMode. Common widescreen modes include 16:9, 16:10 and 2:1.
public bool IsWideScreen { get; }
Property Value
SupportedDisplayModes
Gets a collection of supported display modes for the current adapter.
public DisplayModeCollection SupportedDisplayModes { get; }
Property Value
UseDriverType
Used to request creation of a specific kind of driver.
public static GraphicsAdapter.DriverType UseDriverType { get; set; }
Property Value
Remarks
These values only work on DirectX platforms and must be defined before the graphics device is created. Hardware by default.
UseReferenceDevice
Used to request creation of the reference graphics device, or the default hardware accelerated device (when set to false).
public static bool UseReferenceDevice { get; set; }
Property Value
Remarks
This only works on DirectX platforms where a reference graphics device is available and must be defined before the graphics device is created. It defaults to false.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
IsProfileSupported(GraphicsProfile)
Returns a value that indicates whether the specified graphics profile is supported by the current adapter.
public bool IsProfileSupported(GraphicsProfile graphicsProfile)
Parameters
graphicsProfile
GraphicsProfileThe graphics profile to check for support.
Returns
Exceptions
- InvalidOperationException
The
graphicsProfile
parameter is not a valid GraphicsProfile enum value.
QueryRenderTargetFormat(GraphicsProfile, SurfaceFormat, DepthFormat, int, out SurfaceFormat, out DepthFormat, out int)
Queries for support of the requested render target format on the adaptor.
public bool QueryRenderTargetFormat(GraphicsProfile graphicsProfile, SurfaceFormat format, DepthFormat depthFormat, int multiSampleCount, out SurfaceFormat selectedFormat, out DepthFormat selectedDepthFormat, out int selectedMultiSampleCount)
Parameters
graphicsProfile
GraphicsProfileThe graphics profile.
format
SurfaceFormatThe requested surface format.
depthFormat
DepthFormatThe requested depth stencil format.
multiSampleCount
intThe requested multisample count.
selectedFormat
SurfaceFormatSet to the best format supported by the adaptor for the requested surface format.
selectedDepthFormat
DepthFormatSet to the best format supported by the adaptor for the requested depth stencil format.
selectedMultiSampleCount
intSet to the best count supported by the adaptor for the requested multisample count.
Returns
- bool
True if the requested format is supported by the adaptor. False if one or more of the values was changed.