Vixen
02b45cc4
csharp
public enum PlatformCapabilities

What a platform can actually do, asked at runtime rather than assumed from a #if.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Every capability here is absent on at least one supported target: a dedicated server has no display, a browser has no native file dialogs, a phone has no free-floating windows, and a Linux box under Wayland cannot position a window at all. Code that needs one asks; code that does not, does not care.

The rule from docs/plan/10 § Cross-platform discipline is that feature detection is always a runtime query with a fallback and never a compile-time branch. This enum is where that rule is cashed in.

Fields and properties (15)

  • None

    Nothing — a platform that is only a clock and a file system.

  • Windowing

    Windows can be created and will be shown to somebody.

  • MultiWindow

    More than one window may exist at a time.

  • WindowPositioning

    Window position can be read and set in desktop coordinates.

  • DisplayEnumeration

    Displays can be enumerated, with bounds, refresh rates and scale factors.

  • Cursor

    The mouse cursor can be hidden, confined, or put into relative mode.

  • Clipboard

    The system clipboard is readable and writable.

  • NativeDialogs

    Native open/save/folder pickers and message boxes.

  • TextInput

    Composed text input with an IME, and an on-screen keyboard where there is one.

  • GameControllers

    Gamepads, joysticks and other hot-pluggable input devices.

  • Haptics

    At least one input device can produce force feedback.

  • PowerInfo

    Battery level, charging state and thermal pressure are reported.

  • Suspension

    The process can be suspended and resumed by the OS.

  • DragAndDrop

    Files and text can be dropped onto a window.

  • GlContext

    Windows can produce an OpenGL context — see IGlContextSource.

Used by (17)

  • DesktopGlContextTestsVixen.Platform.Desktop.Tests
  • DesktopPlatformVixen.Platform.Desktop
  • DesktopPlatformTestsVixen.Platform.Desktop.Tests
  • DesktopSupplementTestsVixen.Platform.Desktop.Tests
  • HeadlessPlatformVixen.Platform.Headless
  • HeadlessPlatformTestsVixen.Platform.Headless.Tests
  • IPlatformVixen.Platform
  • LinuxPlatformSupplementVixen.Platform.Linux
  • MacOSPlatformSupplementVixen.Platform.MacOS
  • MacOSSupplementTestsVixen.Platform.MacOS.Tests
  • PlatformExtensionsVixen.Platform
  • PlatformServicesVixen.Platform
  • PlatformWindowHostVixen.Platform.Ui
  • PlatformWindowHostTestsVixen.Platform.Ui.Tests
  • RecordingSupplementVixen.Platform.Desktop.Tests
  • WindowsPlatformSupplementVixen.Platform.Windows
  • EditorServicesVixen.Editor.App