Show / Hide Table of Contents

Class MacOSDisplayComponent

Inheritance
object
MacOSDisplayComponent
Implements
IDisplayComponent
IPalComponent
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenTK.Platform.Native.macOS
Assembly: OpenTK.Platform.dll
Syntax
public class MacOSDisplayComponent : IDisplayComponent, IPalComponent

Properties

CanGetVirtualPosition

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

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

Logger

The logger that this component uses to log diagnostic messages.

Declaration
public ILogger? Logger { get; set; }
Property Value
Type Description
ILogger
See Also
ILogger
Logger

Name

Name of the abstraction layer component.

Declaration
public string Name { get; }
Property Value
Type Description
string

Provides

Specifies which PAL components this object provides.

Declaration
public PalComponents Provides { get; }
Property Value
Type Description
PalComponents

Methods

Close(DisplayHandle)

Close a display handle.

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

Handle to a display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetDirectDisplayID(DisplayHandle)

Returns the CGDirectDisplayID associated with this display handle.

Declaration
public uint GetDirectDisplayID(DisplayHandle handle)
Parameters
Type Name Description
DisplayHandle handle

A handle to a display to get the associated CGDirectDisplayID from.

Returns
Type Description
uint

The CGDirectDisplayID associated with the display handle.

GetDisplayCount()

Get the number of available displays.

Declaration
public int GetDisplayCount()
Returns
Type Description
int

Number of displays available.

GetDisplayScale(DisplayHandle, out float, out float)

Get the scale of the display.

Declaration
public void GetDisplayScale(DisplayHandle handle, out float scaleX, out float scaleY)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

float scaleX

The X-axis scale of the monitor.

float scaleY

The Y-axis scale of the monitor.

GetName(DisplayHandle)

Get the friendly name of a display.

Declaration
public 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, out float)

Get the refresh rate if the specified display.

Declaration
public void GetRefreshRate(DisplayHandle handle, out float refreshRate)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

float refreshRate

The refresh rate of the display.

GetResolution(DisplayHandle, out int, out int)

Get the resolution of the specified display.

Declaration
public void GetResolution(DisplayHandle handle, out int width, out int height)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

int width

The horizontal resolution of the display.

int height

The vertical resolution of the display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetSafeArea(DisplayHandle, out Box2i)

Declaration
public void GetSafeArea(DisplayHandle handle, out Box2i area)
Parameters
Type Name Description
DisplayHandle handle
Box2i area

GetSafeLeftAuxArea(DisplayHandle, out Box2i)

The the top left unobscured area of the screen. Some macOS devices have a portion of the screen covered by the camera housing, this function returns the visible are left to the that. If there is no obscured area of the display this function returns false.

Declaration
public bool GetSafeLeftAuxArea(DisplayHandle handle, out Box2i area)
Parameters
Type Name Description
DisplayHandle handle

The display to get the safe area of.

Box2i area

The top left auxiliary area.

Returns
Type Description
bool

If there is an auxiliary area.

GetSafeRightAuxArea(DisplayHandle, out Box2i)

The the top right unobscured area of the screen. Some macOS devices have a portion of the screen covered by the camera housing, this function returns the visible are left to the that. If there is no obscured area of the display this function returns false.

Declaration
public bool GetSafeRightAuxArea(DisplayHandle handle, out Box2i area)
Parameters
Type Name Description
DisplayHandle handle

The display to get the safe area of.

Box2i area

The top left auxiliary area.

Returns
Type Description
bool

If there is an auxiliary area.

GetSupportedVideoModes(DisplayHandle)

Get all supported video modes for a specific display.

Declaration
public 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, out VideoMode)

Get the active video mode of a display.

Declaration
public void GetVideoMode(DisplayHandle handle, out VideoMode mode)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

VideoMode mode

Active video mode of display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

GetVirtualPosition(DisplayHandle, out int, out int)

Get the position of the display in the virtual desktop.

Declaration
public void GetVirtualPosition(DisplayHandle handle, out int x, out int y)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

int x

Virtual X coordinate of the display.

int y

Virtual Y coordinate of the display.

Exceptions
Type Condition
ArgumentNullException

handle is null.

PalNotImplementedException

Driver cannot get display virtual position. See CanGetVirtualPosition.

GetWorkArea(DisplayHandle, out Box2i)

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
public void GetWorkArea(DisplayHandle handle, out Box2i area)
Parameters
Type Name Description
DisplayHandle handle

Handle to a display.

Box2i area

The work area of the display.

Initialize(ToolkitOptions)

Initialize the component.

Declaration
public void Initialize(ToolkitOptions options)
Parameters
Type Name Description
ToolkitOptions options

The options to initialize the component with.

See Also
ToolkitOptions
Init(ToolkitOptions)

IsPrimary(DisplayHandle)

Checks if a display is the primary display or not.

Declaration
public 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
public 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
public DisplayHandle OpenPrimary()
Returns
Type Description
DisplayHandle

Handle to the primary display.

Uninitialize()

Uninitialize the component. Frees any native resources used by the component.

Declaration
public void Uninitialize()
See Also
Uninit()

Implements

IDisplayComponent
IPalComponent
In this article
Back to top Generated by DocFX