Render phase should auto-clear + auto-present; clear color configured declaratively #86
Labels
No labels
area:ci
area:docs
area:input
area:net
area:rendering
area:repo
area:stdlib
area:tooling
area:types
cleanup
dx
priority:high
priority:low
priority:medium
proposal
status:in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: workshopsoft/ludic#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Games must manually call
Screen.clear(color)at the top andScreen.show()at the bottom of every Render handler. Only the light system currently auto-presents ("the engine owns the flip for an ECS-lit frame").Proposal: the Render phase auto-clears (to a configurable clear color set declaratively — a scene/world property or
@ClearColor, not in the handler body) and auto-presents after Render handlers run, so games don't repeat clear/show boilerplate.Shipped in
d9287d6(real implementation, tested — full suite 108/0, golden renders byte-identical, C-free bootstrap fixpoint intact).@ClearColor(0xRRGGBB)declares the framebuffer clear colour, and the engine then owns the per-frame clear + flip: at the top of the Render phase it clears the framebuffer to the colour, and after all Render handlers run it presents the frame. A game's Render handler no longer repeatsScreen.clear(color)/Screen.show(), and the clear colour is configured declaratively (an annotation), not in the handler body — exactly as the proposal asked.Backward-compatible / opt-in: a program with no
@ClearColoris byte-for-byte identical — it clears and presents itself, or (for an ECS-lit frame) the light system still owns the present. The clear/present emit is gated on the annotation flag.Verified by
examples/library/clear_color.ludic: a handler game with@ClearColor(0x102030)and a Render handler that draws a box but calls no Screen.clear/show; pixel readback after the frame confirms an undrawn pixel holds 0x102030 (so the engine cleared) and the box is present. Wired as a feat_case; docs page + inventory entry added.