Class Window¶
Namespace: Apogee.Platform
Assembly: Apogee.Platform.dll
An SDL window. Create it after
public sealed class Window : IDisposable
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
Window(string, int, int, WindowOptions)¶
public Window(string title, int width, int height, WindowOptions options = WindowOptions.Resizable | WindowOptions.HighPixelDensity)
Parameters¶
title string
width int
height int
options WindowOptions
Properties¶
CloseRequested¶
The user clicked the close button (or the platform asked the window to close). The application decides what happens.
public bool CloseRequested { get; }
Property Value¶
HasFocus¶
The window has keyboard focus.
public bool HasFocus { get; }
Property Value¶
Id¶
public uint Id { get; }
Property Value¶
IsMinimized¶
public bool IsMinimized { get; }
Property Value¶
LogicalSize¶
The size in points, which is what the window manager and mouse coordinates use.
public (int Width, int Height) LogicalSize { get; }
Property Value¶
NativeHandle¶
The SDL window, for code that talks to SDL directly (the dev tools' input backend).
public Window* NativeHandle { get; }
Property Value¶
Window*
PixelDensity¶
Pixels per point: 1 on a standard display, 2 on Retina, 1.5 at 150% scaling.
public float PixelDensity { get; }
Property Value¶
PixelSize¶
The size of the window's drawable area in pixels: the swapchain's size. Empty while minimized on some platforms.
public PixelSize PixelSize { get; }
Property Value¶
Title¶
public string Title { get; set; }
Property Value¶
Methods¶
ClearCloseRequest()¶
public void ClearCloseRequest()
ConsumeResize()¶
True once when the pixel size differs from the last time this returned true or the window was created: the swapchain has to be recreated.
public bool ConsumeResize()
Returns¶
Dispose()¶
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
SetFullscreen(bool)¶
public void SetFullscreen(bool fullscreen)
Parameters¶
fullscreen bool
SetIcon(int, int, ReadOnlySpan<byte>)¶
Gives the window an icon, from width x height pixels of RGBA8 (four bytes a pixel, rows one after the other). What shows it (the title bar, the task bar,
the window switcher) is up to the platform: Windows and macOS take theirs from the executable and the bundle, and a driver without icons returns false.
public bool SetIcon(int width, int height, ReadOnlySpan<byte> rgba)
Parameters¶
width int
height int
rgba ReadOnlySpan<byte>
Returns¶
Exceptions¶
rgba is smaller than the image.
SetMouseLook(bool)¶
Hides the pointer and reports only its movement (for a camera that turns with the mouse); false gives the pointer back.
public void SetMouseLook(bool enabled)
Parameters¶
enabled bool