Class X11DisplayComponent
Inherited Members
Namespace: OpenTK.Platform.Native.X11
Assembly: OpenTK.Platform.dll
Syntax
public class X11DisplayComponent : IDisplayComponent, IPalComponent
Properties
CanGetVirtualPosition
True if the driver can get the virtual position of the display using GetVirtualPosition(DisplayHandle).
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
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 |
|
GetDisplayCount()
Get the number of available displays.
Declaration
public int GetDisplayCount()
Returns
| Type | Description |
|---|---|
| int | Number of displays available. |
GetDisplayScale(DisplayHandle)
Get the scale of the display.
Declaration
public 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
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 |
|
GetRRCrtc(DisplayHandle)
Gets the RandR RRCrtc associated with the display handle.
Declaration
public nint GetRRCrtc(DisplayHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayHandle | handle | A handle to a display to get the |
Returns
| Type | Description |
|---|---|
| nint | The |
GetRROutput(DisplayHandle)
Gets the RandR RROutput associated with the display handle.
Declaration
public nint GetRROutput(DisplayHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayHandle | handle | A handle to a display to get the |
Returns
| Type | Description |
|---|---|
| nint | The |
GetRefreshRate(DisplayHandle)
Get the refresh rate if the specified display.
Declaration
public 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
public 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 |
|
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 |
|
GetVideoMode(DisplayHandle)
Get the active video mode of a display.
Declaration
public 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 |
|
GetVirtualPosition(DisplayHandle)
Get the position of the display in the virtual desktop.
Declaration
public 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 |
|
| 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
public Box2i GetWorkArea(DisplayHandle handle)
Parameters
| Type | Name | Description |
|---|---|---|
| DisplayHandle | handle | Handle to a display. |
Returns
| Type | Description |
|---|---|
| Box2i | 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
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 |
|
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()