Runtime window wrapper with framebuffer configuration and render signals.

Window exposes the platform window as a higher-level engine object. It keeps the current back buffer, mirrors platform window properties, and emits a render signal every frame with the texture that should be drawn into.

Most applications configure the initial window inside the setup callback passed to App.start.

Constructor

@:access(s.App)new(w:KhaWindow)

Variables

@:value(false)borderless:Bool = false

Whether the window should be borderless.

@:value(32)colorBufferBits:Int = 32

Color buffer bit depth.

@:value(16)depthBufferBits:Int = 16

Depth buffer bit depth.

@:value(60)frequency:Int = 60

Preferred refresh frequency for the framebuffer.

This participates in framebuffer reconfiguration and does not directly move the OS window to another display mode by itself.

@:value(0)read onlyheight:Int = 0

Current window height in pixels.

This is updated from platform resize notifications and should be treated as informational state, not as a writable requested size.

@:value(true)maximizable:Bool = true

Whether the window can be maximized.

@:value(true)minimizable:Bool = true

Whether the window can be minimized.

mode:WindowMode

Current window mode.

@:value(false)onTop:Bool = false

Whether the window should stay on top.

@:value(new s.shortcut.signals.Signal([]))read onlyrender:Signal<(target:Texture) ‑> Void> = new s.shortcut.signals.Signal([])

Fired every frame with the window back buffer as the render target.

Rendering code should draw into the provided texture rather than directly to the platform framebuffer.

@:value(true)resizable:Bool = true

Whether the user can resize the window.

@:value(new s.shortcut.signals.Signal([]))read onlyresized:Signal<(width:Int, height:Int) ‑> Void> = new s.shortcut.signals.Signal([])

Fired after the window size changes.

The back buffer has already been recreated when this signal runs.

@:value(1)samplesPerPixel:Int = 1

Multisample count.

@:value(8)stencilBufferBits:Int = 8

Stencil buffer bit depth.

title:String

Window title.

read onlyvSynced:Bool

Whether the active framebuffer is synchronized to vertical refresh.

This reflects the state of the underlying window framebuffer after it has been configured.

@:value(true)verticalSync:Bool = true

Whether framebuffer presentation should use vertical sync.

@:value(0)read onlywidth:Int = 0

Current window width in pixels.

This is updated from platform resize notifications and should be treated as informational state, not as a writable requested size.

x:Int

Window X position in screen coordinates.

y:Int

Window Y position in screen coordinates.

Methods

inlinedestroy():Void

Destroys the underlying platform window.

inlinemove(x:Int, y:Int):Void

Moves the window.

Parameters:

x

New X position.

y

New Y position.

offRender(slot:(target:Texture) ‑> Void):Bool

offResized(slot:(width:Int, height:Int) ‑> Void):Bool

onRender(slot:(target:Texture) ‑> Void):(target:Texture) ‑> Void

onResized(slot:(width:Int, height:Int) ‑> Void):(width:Int, height:Int) ‑> Void

inlineresize(width:Int, height:Int):Void

Resizes the window.

This requests a new platform window size. The actual current size becomes visible through width and height after the resize callback is received.

Parameters:

width

New width in pixels.

height

New height in pixels.