public interface IWindowOne window, or one thing shaped like a window.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
"Shaped like a window" is not a hedge. A headless platform creates these too: they have a size, an id, a lifecycle and an event stream, and their Surface reports None. That is what lets the dedicated server run the same frame loop as the desktop build rather than a second one written for it, and it is why the headless path is exercised on every test run instead of being discovered to have rotted in Phase 9.
Properties report the platform's answer, not the last thing that was asked for. Setting ClientSize is a request: a tiling window manager may ignore it, a mobile platform certainly will, and reading it back afterwards may return something else. Code that needs to know what happened listens for WindowResized.
Disposing destroys the window. Closing it from the title bar does not — that arrives as WindowCloseRequested and the window stays open until the application agrees, which is what makes "save before quitting?" possible.
Fields and properties (16)
uint IdThis window's id, as it appears in WindowId.
string TitleThe title bar text.
Int2 ClientSizeThe client area's size in logical points.
Int2 FramebufferSizeThe framebuffer's size in physical pixels — ClientSize times DpiScale, subject to the platform's rounding.
Int2 PositionThe top-left corner in desktop coordinates.
float DpiScaleHow many physical pixels there are per logical point.
WindowMode ModeHow the window relates to its display.
bool IsResizableWhether the user may resize it.
bool IsVisibleWhether it is currently on screen.
bool IsFocusedWhether it has keyboard focus.
bool IsMinimisedWhether it is minimised, and therefore not worth rendering to.
bool IsClosedWhether it has been disposed. Every other member throws once this is true.
int DisplayIndexWhich display it is mostly on.
CursorMode CursorModeWhat the cursor does over it.
CursorShape CursorShapeWhich stock cursor to draw over it.
ISurface SurfaceThe thing a graphics backend presents to.
Methods (6)
void Show()Shows the window.
void Hide()Hides the window without destroying it.
void Focus()Asks for keyboard focus.
void Centre()Centres the window on its display.
void RequestAttention()Asks the OS to draw attention to the window — a bouncing dock icon, a flashing taskbar button.
void SetIcon(ReadOnlySpan<byte> pixels, Int2 size)Sets the window and taskbar icon from straight (non-premultiplied) RGBA8 pixels.
Used by (48, showing 40)
- MouseCaptureSystemThirdPersonShooter
- PbrShowcaseGamePbrShowcase
- ProgramHelloUi
- TriangleGameHelloTriangle
- UiHostHelloUi
- VideoGameVideoPlayback
- VirtualGeometryGameVirtualGeometry
- AppBuilderVixen.App.Hosting
- AppGraphicsVixen.App.Hosting
- AppServicesVixen.App.Hosting
- DesktopDialogsVixen.Platform.Desktop
- DesktopDisplaysVixen.Platform.Desktop
- DesktopGlContextTestsVixen.Platform.Desktop.Tests
- DesktopPlatformVixen.Platform.Desktop
- DesktopPlatformTestsVixen.Platform.Desktop.Tests
- DesktopTextInputVixen.Platform.Desktop
- DesktopWindowVixen.Platform.Desktop
- HeadlessDialogsVixen.Platform.Headless
- HeadlessDisplaysVixen.Platform.Headless
- HeadlessLifecycleTestsVixen.Platform.Headless.Tests
- HeadlessPlatformVixen.Platform.Headless
- HeadlessPlatformTestsVixen.Platform.Headless.Tests
- HeadlessTextInputVixen.Platform.Headless
- HeadlessWindowVixen.Platform.Headless
- IDisplayInfoVixen.Platform
- IGraphicsBackendVixen.App.Hosting
- INativeDialogsVixen.Platform
- IPlatformVixen.Platform
- ITextInputVixen.Platform
- LinuxDialogsVixen.Platform.Linux
- MacOSDialogsVixen.Platform.MacOS
- NothingDialogsVixen.Platform.Desktop.Tests
- NothingDialogsVixen.Platform.MacOS.Tests
- PlatformExtensionsVixen.Platform
- PlatformExtensionsTestsVixen.Platform.Headless.Tests
- PlatformUiWindowVixen.Platform.Ui
- PlatformWindowHostVixen.Platform.Ui
- PlatformWindowHostTestsVixen.Platform.Ui.Tests
- VixenApplicationVixen.App.Hosting
- WindowsDialogsVixen.Platform.Windows