Table of Contents

Struct DisplayInfo

Namespace
Cobilas.GodotEngine.Utility
Assembly
com.cobilas.godot.utility.dll

Contains information from a specific screen.

public readonly struct DisplayInfo : IEquatable<DisplayInfo>
Implements
Inherited Members

Constructors

DisplayInfo(in int, in DisplayDevice?)

Starts a new instance of the object.

public DisplayInfo(in int index, in DisplayDevice? device)

Parameters

index int

The monitor index.

device DisplayDevice

The OpenTK.DisplayDevice that contains the screen information.

Properties

CurrentResolution

Current screen resolution.

public Resolution CurrentResolution { get; }

Property Value

Resolution

Returns the current resolution of this OpenTK.DisplayDevice.

CustonResolutions

The list of custom resolutions.

public CustonResolutionList CustonResolutions { get; }

Property Value

CustonResolutionList

Returns a list of custom resolutions from DisplayInfo.

Index

Screen index

public int Index { get; }

Property Value

int

Returns the screen index.

None

Empty display.

public static DisplayInfo None { get; }

Property Value

DisplayInfo

Returns an empty instance of DisplayInfo.

Resolutions

Screen resolutions.

public Resolution[] Resolutions { get; }

Property Value

Resolution[]

Returns all resolutions supported by the display.

Methods

AddCustonResolution(in Resolution, in DisplayInfo)

Adds a custom resolution to DisplayInfo.

public static DisplayInfo AddCustonResolution(in Resolution resolution, in DisplayInfo display)

Parameters

resolution Resolution

The resolution to be added.

display DisplayInfo

The target DisplayInfo.

Returns

DisplayInfo

Returns a new, modified instance of DisplayInfo.

ChangeCurrentResolution(in Resolution, in DisplayInfo)

Allows you to change the current resolution of this display.

public static DisplayInfo ChangeCurrentResolution(in Resolution resolution, in DisplayInfo display)

Parameters

resolution Resolution

The new resolution.

display DisplayInfo

The target DisplayInfo.

Returns

DisplayInfo

Returns a new, modified instance of DisplayInfo.

Contains(in Resolution, in bool)

Allows you to check whether a certain resolution exists on this display.

public bool Contains(in Resolution resolution, in bool includeCustomResolution = false)

Parameters

resolution Resolution

Target resolution.

includeCustomResolution bool

Tells the method whether to compare with the custom resolution list.

Returns

bool

If the resolution exists, it will return true.

Equals(DisplayInfo)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(DisplayInfo other)

Parameters

other DisplayInfo

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHash(in DisplayInfo)

Generates a hash from DisplayInfo.

public static int GetHash(in DisplayInfo display)

Parameters

display DisplayInfo

The object that will be used.

Returns

int

Returns a hash generated from the DisplayInfo index and resolution list.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(DisplayInfo, DisplayInfo)

Indicates whether this instance is equal to another instance of the same type.

public static bool operator ==(DisplayInfo A, DisplayInfo B)

Parameters

A DisplayInfo

Object to be compared.

B DisplayInfo

Object of comparison.

Returns

bool

Returns the result of the comparison.

operator !=(DisplayInfo, DisplayInfo)

Indicates whether this instance is different from another instance of the same type.

public static bool operator !=(DisplayInfo A, DisplayInfo B)

Parameters

A DisplayInfo

Object to be compared.

B DisplayInfo

Object of comparison.

Returns

bool

Returns the result of the comparison.