Interface IDesktopSizeProvider
Represents a platform-specific way to read the desktop resolution of the monitor a native window is on.
public interface IDesktopSizeProvider
- Extension Methods
Remarks
The desktop resolution is the one the user configured, not a mode a fullscreen game switched to temporarily. It is the physical panel a touch screen measures against: engine connectors use it to map touches onto a back buffer that fullscreen presents letterboxed (see PointerSurfaceMapping).
Obtain the implementation for the current platform from GetProvider(). Platforms without one report the size as unknown, and callers keep their unmapped behavior.
Methods
TryGetDesktopSize(in NativeWindowInfo, out Size)
Tries to get the desktop resolution of the monitor window is on.
bool TryGetDesktopSize(in NativeWindowInfo window, out Size size)
Parameters
windowNativeWindowInfoThe native window; a Handle of
0means the primary monitor.sizeSizeThe desktop resolution in physical pixels, or Empty when unknown.