acron.window

The window: the prc a game needs before ShowBase, the Retina re-request, and a frame rendered from inside a long call.

Three rules from RUNTIME.md, as one place (found building REGOLITH’s seat; every app on this engine hits them in the same order):

  • apply_prc() — what must be in the prc BEFORE ShowBase exists: the window’s title, the stencil buffer RmlUi clips with (rule 4), no MSAA (rule 13: on the Apple GL path multisampling is the dominant frame cost; a ship target that does not pay it turns it back on), and dpi-aware (rule 19: without it a Retina window gets a 1× point backing stretched 2× and everything renders at half the linear resolution the display has). Optionally the filesystem root on the model-path, so an RmlUi <img src="/abs/path"> resolves — RmlUi’s JoinPath strips the leading slash and the engine’s file interface falls back to the model-path.

  • fit_window() — dpi-aware makes the requested win-size device pixels, so the default window would open at half its POINT size on a Retina display: re-request it at size × display zoom after opening (same physical window, real pixels behind it). Everything downstream re-fits off the resize event. Offscreen buffers are exact-size and untouched.

  • blocking_frame() — a bake is one long call and nothing else runs a frame until it returns; a loading bar advanced from inside its progress callback needs a frame rendered right there. With the scene half-built a shader can exist whose per-frame inputs do not yet (rule 17: Acron asserts on a declared uniform with no input), so the caller names what to hide for the frame — render, typically.

Global Functions

apply_prc(title: str, *, stencil: bool = True, msaa: bool = False, dpi_aware: bool = True, absolute_img_src: bool = False, name: str = 'acron-window') → None

Engine settings that must be in place before ShowBase exists. name labels the prc data (what print(cpMgr) shows). The stencil line is acron.ui.apply_prc()’s — the one line a game that sets the rest of its prc itself still needs (RUNTIME rule 4).

blocking_frame(base, *hidden) → None

Render one frame now, from inside whatever long call is running, with the given NodePaths hidden for it (a scene still being built).

fit_window(base) → None

Re-request a dpi-aware window at its point size × the display zoom, so it keeps its physical footprint with device pixels behind it. A no-op for an offscreen buffer or a 1× display.