public sealed class DesktopPlatformWindows, Linux and macOS, through one SDL implementation.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One implementation for all three, because SDL already absorbed the differences that matter for windowing, input, gamepads, clipboard text and IME. What it does not cover — file pickers, clipboard images and application-defined formats, thread affinity, thermal state — comes from Vixen.Platform.Windows, .Linux or .MacOS through an IPlatformSupplement, chosen at construction and turned off with UseNativeSupplement. Nothing above this assembly has to know which one it got: the services arrive through the same interfaces either way, and Capabilities is what says whether the pickers are real.
Owned by the thread that constructed it. That is SDL's rule and the operating systems' beneath it, not a simplification of ours.
Fields and properties (13)
public string NameA name for logs and crash reports: "Desktop (macOS)", "Headless".
public PlatformCapabilities CapabilitiesWhat SDL can do here, decided at construction from what it reports rather than from the operating system's name.
public IReadOnlyList<IWindow> WindowsEvery window that exists now, in creation order.
public IDisplayInfo DisplaysThe displays.
public IFileSystemHost FileSystemWhere this platform keeps files.
public IClipboard ClipboardThe system clipboard.
public INativeDialogs DialogsNative pickers and message boxes.
public ILifecycle LifecycleThe process's lifecycle.
public IInputSource InputRaw input devices and their state.
public ITextInput TextInputText entry and the IME.
public IPowerInfo PowerBattery and thermal state.
public IProcessorTopology ProcessorsHow many processors there are, and whether threads may be pinned to them.
public string VideoDriverWhich video driver SDL chose: "windows", "cocoa", "wayland", "x11".
Methods (7)
public DesktopPlatform()Starts SDL and builds the platform.
public DesktopPlatform(DesktopPlatformOptions options)Creates the platform.
public IWindow CreateWindow(in WindowOptions options)Creates a window.
public bool TryGetWindow(uint id, out IWindow? window)Finds a window by the id its events carry.
public ReadOnlySpan<PlatformEvent> PumpEvents()Collects everything the OS has to say and returns it, in the order it happened.
public bool TryOpenUrl(string url)Opens a URL in whatever the user has set as their handler for it.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (10)
- ProgramHelloUi
- ProgramPbrShowcase
- ProgramHelloTriangle
- ProgramVideoPlayback
- ProgramVirtualGeometry
- DesktopGlContextTestsVixen.Platform.Desktop.Tests
- DesktopPlatformTestsVixen.Platform.Desktop.Tests
- DesktopSupplementTestsVixen.Platform.Desktop.Tests
- PlatformHostVixen.App
- ProgramVixen.Editor.Host