Table of Contents

Class GraphicsOutput

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Represents an output (such as a monitor) attached to a GraphicsAdapter.

public sealed class GraphicsOutput : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
object
GraphicsOutput
Implements
Inherited Members
Extension Methods

Properties

Adapter

Gets the GraphicsAdapter this output is attached to.

public GraphicsAdapter Adapter { get; }

Property Value

GraphicsAdapter

BitsPerChannel

Gets the number of bits per color channel for the active wire format of the display attached to this output.

public int BitsPerChannel { get; }

Property Value

int

BluePrimary

Gets the blue color primary, in XY coordinates, of the display attached to this output.

public Vector2 BluePrimary { get; }

Property Value

Vector2

ColorSpace

Gets the advanced color capabilities of the display attached to this output.

public ColorSpaceType ColorSpace { get; }

Property Value

ColorSpaceType

The advanced color space of the output. Specifically, whether it's capable of reproducing color and luminance values outside of the sRGB color space.

CurrentDisplayMode

Gets the current display mode of this GraphicsOutput.

public DisplayMode? CurrentDisplayMode { get; }

Property Value

DisplayMode?

Description

Gets a description or friendly name of the output.

public string Description { get; }

Property Value

string

DesktopBounds

Gets the desktop bounds of the current GraphicsOutput.

public Rectangle DesktopBounds { get; }

Property Value

Rectangle

GreenPrimary

Gets the green color primary, in XY coordinates, of the display attached to this output.

public Vector2 GreenPrimary { get; }

Property Value

Vector2

IsAttached

Gets a value indicating whether the output (monitor) is currently attached to the Windows desktop.

public bool IsAttached { get; }

Property Value

bool
  • true if the output (monitor) is part of the visible workspace, meaning the device is connected and has valid desktop coordinates;
  • false if it is known but disconnected or disabled, and thus not part of the desktop.

MaxFullFrameLuminance

Gets the maximum luminance, in nits, that the display attached to this output is capable of rendering when a color fills the entire area of the panel.

public float MaxFullFrameLuminance { get; }

Property Value

float

Remarks

Content should not exceed this value across the entire panel for optimal rendering.

MaxLuminance

Gets the maximum luminance, in nits, that the display attached to this output is capable of rendering.

public float MaxLuminance { get; }

Property Value

float

Remarks

This value is likely only valid for a small area of the panel. Content should not exceed this maximum value for optimal rendering.

MinLuminance

Gets the minimum luminance, in nits, that the display attached to this output is capable of rendering.

public float MinLuminance { get; }

Property Value

float

Remarks

Content should not exceed this minimum value for optimal rendering.

MonitorHandle

Gets the handle of the monitor associated with this GraphicsOutput.

public nint MonitorHandle { get; }

Property Value

nint

RedPrimary

Gets the red color primary, in XY coordinates, of the display attached to this output.

public Vector2 RedPrimary { get; }

Property Value

Vector2

Rotation

Gets the rotation of the display attached to this output.

public DisplayRotation Rotation { get; }

Property Value

DisplayRotation

Remarks

This value indicates how the Back-Buffers should be rotated to fit the physical rotation of a monitor.

SupportedDisplayModes

Returns a collection of the supported display modes for this GraphicsOutput.

public ReadOnlySpan<DisplayMode> SupportedDisplayModes { get; }

Property Value

ReadOnlySpan<DisplayMode>

SupportsHDR

Gets a value indicating whether High Dynamic Range (HDR) is supported by the current device or display configuration.

public bool SupportsHDR { get; }

Property Value

bool

WhitePoint

Gets the white point, in XY coordinates, of the display attached to this output.

public Vector2 WhitePoint { get; }

Property Value

Vector2

Methods

Destroy()

Disposes the object's resources.

protected override void Destroy()

Remarks

Override in a derived class to implement disposal logic specific to it.

This method is automatically called whenever a call to Dispose() (or to Release()) has decreased the internal reference count to zero, meaning no other objects (hopefully) hold a reference to this one and its resources can be safely released.

FindClosestMatchingDisplayMode(ReadOnlySpan<GraphicsProfile>, DisplayMode)

Finds the display mode that most closely matches the requested display mode.

public DisplayMode FindClosestMatchingDisplayMode(ReadOnlySpan<GraphicsProfile> targetProfiles, DisplayMode modeToMatch)

Parameters

targetProfiles ReadOnlySpan<GraphicsProfile>

The target profiles, as available formats differ depending on the graphics profile.

modeToMatch DisplayMode

The desired display mode.

Members of DisplayMode can be unspecified indicating no preference for that member.

A value of 0 for Width or Height indicates the value is unspecified. If either Width or Height are 0, both must be 0.

A numerator and denominator of 0 in RefreshRate indicate it is unspecified.

A value of None for DisplayMode indicates the pixel format is unspecified.

Returns

DisplayMode

Returns the mode that most closely matches modeToMatch.

Remarks

Direct3D devices require UNORM pixel formats.

Unspecified fields are lower priority than specified fields and will be resolved later than specified fields. Similarly ranked fields (i.e. all specified, or all unspecified, etc.) are resolved in the following order: Format, Width, Height, RefreshRate.

When determining the closest value for a particular field, previously matched fields are used to filter the display mode list choices, and other fields are ignored. For example, when matching resolution, the display mode list will have already been filtered by a certain pixel format, while the refresh rate is ignored.

This ordering doesn't define the absolute ordering for every usage scenario of FindClosestMatchingDisplayMode(ReadOnlySpan<GraphicsProfile>, DisplayMode), because the application can choose some values initially, effectively changing the order that fields are chosen. Fields of the display mode are matched one at a time, generally in a specified order. If a field is unspecified, this method gravitates toward the values for the desktop related to this output. If this output is not part of the desktop, then the default desktop output is used to find values.

If an application uses a fully unspecified display mode, FindClosestMatchingDisplayMode(ReadOnlySpan<GraphicsProfile>, DisplayMode) will typically return a display mode that matches the desktop settings for this output.

Exceptions

ArgumentNullException

targetProfiles is empty and does not specify any graphics profile to test.