Show / Hide Table of Contents

Interface IDisplayComponent

Interface for drivers which provide the display component.

Inherited Members
IPalComponent.Name
IPalComponent.Provides
IPalComponent.Logger
IPalComponent.Initialize(ToolkitOptions)
IPalComponent.Uninitialize()
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public interface IDisplayComponent : IPalComponent

Properties

CanGetVirtualPosition

True if the driver can get the virtual position of the display using GetVirtualPosition(DisplayHandle).

Declaration
bool CanGetVirtualPosition { get; }
Property Value
Type Description
bool

Methods

Close(DisplayHandle)

Close a display handle.

Declaration
void Close(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetDisplayCount()

Get the number of available displays.

Declaration
int GetDisplayCount()
Returns
Type Description
int

Number of displays available.

GetDisplayScale(DisplayHandle)

Get the scale of the display.

Declaration
Vector2 GetDisplayScale(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
Vector2

The X-axis and Y-axis scale of the monitor.

GetName(DisplayHandle)

Get the friendly name of a display.

Declaration
string GetName(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
string

Display name.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetRefreshRate(DisplayHandle)

Get the refresh rate if the specified display.

Declaration
float GetRefreshRate(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
float

The refresh rate of the display in Hz.

GetResolution(DisplayHandle)

Get the resolution of the specified display.

Declaration
Vector2i GetResolution(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
Vector2i

The horizontal and vertical resolution of the display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetSupportedVideoModes(DisplayHandle)

Get all supported video modes for a specific display.

Declaration
VideoMode[] GetSupportedVideoModes(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
VideoMode[]

An array of all supported video modes.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetVideoMode(DisplayHandle)

Get the active video mode of a display.

Declaration
VideoMode GetVideoMode(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
VideoMode

The active video mode of display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetVirtualPosition(DisplayHandle)

Get the position of the display in the virtual desktop.

Declaration
Vector2i GetVirtualPosition(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
Vector2i

The virtual positition of the display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

PalNotImplementedException

Driver cannot get display virtual position. See CanGetVirtualPosition.

GetWorkArea(DisplayHandle)

Get the work area of this display. The work area is the area of the display that is not covered by task bars or menu bars.

Declaration
Box2i GetWorkArea(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Returns
Type Description
Box2i

The work area of the display.

IsPrimary(DisplayHandle)

Checks if a display is the primary display or not.

Declaration
bool IsPrimary(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

The display to check whether or not is the primary display.

Returns
Type Description
bool

If this display is the primary display.

Open(int)

Create a display handle to the indexed display.

Declaration
DisplayHandle Open(int index)
Parameters
Type Name Description
int index

The display index to create a display handle to.

Returns
Type Description
DisplayHandle

Handle to the display.

Exceptions
Type Condition
ArgumentOutOfRangeException

index is out of range.

OpenPrimary()

Create a display handle to the primary display.

Declaration
DisplayHandle OpenPrimary()
Returns
Type Description
DisplayHandle

Handle to the primary display.

See Also

Display
In this article
Back to top Generated by DocFX