public sealed class DesktopWindowAn SDL window.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Properties read SDL rather than a cached copy, because a window manager is entitled to ignore what it was asked for: a tiling compositor decides the size, Wayland decides the position and will not say what it chose, and a fullscreen transition changes both. Code that must know what happened listens for WindowResized.
Disposing destroys the window; the title-bar close button does not, and arrives as WindowCloseRequested instead.
Fields and properties (16)
public uint IdThis window's id, as it appears in WindowId.
public string TitleThe title bar text.
public Int2 ClientSizeThe client area's size in logical points.
public Int2 FramebufferSizeThe framebuffer's size in physical pixels — ClientSize times DpiScale, subject to the platform's rounding.
public Int2 PositionThe top-left corner in desktop coordinates.
public float DpiScalePhysical pixels per logical point, derived from the two sizes SDL reports rather than from its DPI query.
public WindowMode ModeHow the window relates to its display.
public bool IsResizableWhether the user may resize it.
public bool IsVisibleWhether it is currently on screen.
public bool IsFocusedWhether it has keyboard focus.
public bool IsMinimisedWhether it is minimised, and therefore not worth rendering to.
public bool IsClosedWhether it has been disposed. Every other member throws once this is true.
public int DisplayIndexWhich display it is mostly on.
public CursorMode CursorModeWhat the cursor does over it.
public CursorShape CursorShapeWhich stock cursor to draw over it.
public ISurface SurfaceThe thing a graphics backend presents to.
Methods (8)
public void Show()Shows the window.
public void Hide()Hides the window without destroying it.
public void Focus()Asks for keyboard focus.
public void Centre()Centres the window on its display.
public void RequestAttention()Asks the OS to draw attention to the window — a bouncing dock icon, a flashing taskbar button.
public void SetIcon(ReadOnlySpan<byte> pixels, Int2 size)Sets the window and taskbar icon from straight (non-premultiplied) RGBA8 pixels.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public bool TryCreateGlContext(in GlContextRequest request, out IGlContext? context, out string? reason)
Used by (5)
- DesktopDialogsVixen.Platform.Desktop
- DesktopDisplaysVixen.Platform.Desktop
- DesktopPlatformVixen.Platform.Desktop
- DesktopSurfaceVixen.Platform.Desktop
- DesktopTextInputVixen.Platform.Desktop