Interface IDisplayComponent
Interface for drivers which provide the display component.
Inherited Members
Namespace: OpenTK.Core.Platform
Assembly: OpenTK.Core.dll
Syntax
public interface IDisplayComponent : IPalComponent
Properties
CanGetVirtualPosition
True if the driver can get the virtual position of the display.
Declaration
bool CanGetVirtualPosition { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Close(DisplayHandle)
Destroy a display handle.
Declaration
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
int GetDisplayCount()
Returns
Type | Description |
---|---|
int | Number of displays available. |
GetDisplayScale(DisplayHandle, out float, out float)
Get the scale of the display.
Declaration
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
string GetName(DisplayHandle handle)
Parameters
Type | Name | Description |
---|---|---|
DisplayHandle | handle | Handle to a display. |
Returns
Type | Description |
---|---|
string | Display name. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetRefreshRate(DisplayHandle, out float)
Get the refresh rate if the specified display.
Declaration
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
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 |
|
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 |
|
GetVideoMode(DisplayHandle, out VideoMode)
Get the active video mode of a display.
Declaration
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 |
|
GetVirtualPosition(DisplayHandle, out int, out int)
Get the position of the display in the virtual desktop.
Declaration
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 |
|
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
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. |
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 |
|
OpenPrimary()
Create a display handle to the primary display.
Declaration
DisplayHandle OpenPrimary()
Returns
Type | Description |
---|---|
DisplayHandle | Handle to the primary display. |