Rether / docs
engine/Window & Native surface
referenceWindow & Native surface

Window & Native surface

updated 2026.08.27created 2026.07.27~1 min

The concept

A window or native surface is a abstraction provided by the OS to reserve display space on the screen and capture user interactions.

In game engine

The window fulfills three essential roles:

  1. The render target: The GPU cannot draw "into thin air". To display pixels to the user, the graphics API needs a bridge to the OS. The window provides the native handle (e.g., HWND on Windows, Window on X11/Linux, CAMetalLayer on macOS) that allows the API to create the Swapchain.
  2. Event handling (Event Pump): The window intercepts signals from the OS (mouse movement, key presses, window closure, loss of focus) and forwards them to the engine’s input system.
  3. Resolution and aspect ratio management (Framebuffer Extent): This defines the display buffer’s size in pixels and indicates when that size changes (resizing).

SwapchainSwapchain

Relation with other engine concepts

  • Swapchain: The Swapchain is window-dependent. If the window size changes, the Swapchain must be destroyed and then reallocated to accommodate the new resolution.
  • Input Manager: The Input Manager reads the events captured by the window for each frame via an interrogation request.
  • Main Loop: This window controls the application's lifetime. If the user clicks the X, the main loop stops.

Keyboard

search this vault⌘K / /
step the sidebarjk
open selected↵
switch browse mode123
switch vaultgv
toggle themet
close / clearesc
this help?
esc to close