Skip to content

Several windows in one event loop - #36

Merged
O6lvl4 merged 1 commit into
mainfrom
multi-window
Oct 1, 2026
Merged

O6lvl4 merged 1 commit into
mainfrom
multi-window

Conversation

@O6lvl4

@O6lvl4 O6lvl4 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

open still opens window 1 and a one-window program needs no change. More windows open with open_window(title, w, h) -> id.

  • Per-window calls (size, resized, title, focus, IME, pointer, full screen, background, minimize, attention) are about the window select(id) chose, and gpu render passes draw into its surface. The other windows' surfaces are parked and swapped in by select. present_frame presents every window that drew.
  • Every input carries its window (event_window). With more than one window open, a close button is a CLOSE event for that window; with one, pump/wait return false as before. Quitting still makes them return false.
  • New windows open hidden, cascade 24 pt from the current one, and show with their first frame. close_window(id) drops a window and its surface.
  • set_low_latency and set_option_as_alt apply to every window, including those opened later.

Checked: examples/window draws pixel-identical to main. The new examples/windows opens two windows, draws the scene in each at its own size, and saves both frames.

…ent_window, a CLOSE event; a surface per window, the selected one drawn into
@O6lvl4
O6lvl4 merged commit 8e88f59 into main Oct 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant