Repository navigation
Headless without EGL draws offscreen, as with EGL - #128
Merged
Merged
Conversation
Where the build has no EGL (Windows, macOS) a headless engine falls back to a hidden SDL3 window. It drew into that window's own framebuffer, so a readback after strata_resize could come back black (the hidden window's size changes asynchronously and follows display scaling), the window's RESIZED events leaked out of a surface documented to have no platform events, and depth readback was unsupported. Natively the hidden window now only holds the GL context: the engine draws into the offscreen target at exactly the requested size, resize sets that size, poll_event returns only injected events, and present does nothing. Browsers keep drawing the hidden canvas directly. No ABI change. examples/embed-offscreen is a plain-C host that draws into its own buffer with injected input; it runs as the strata-embed-offscreen test (--check, skipped with 77 where no headless surface can be made). It passes on EGL and on the stand-in (SDL's offscreen video driver), and failed six checks on the stand-in before this change. Goldens through the stand-in match the EGL run (36 of 37 pass on both; tex_globe_sun is the known local Mesa 21 difference). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LYNeunMSrWW3U3RS97BYKD
dmccoystephenson
added a commit
that referenced
this pull request
Nov 28, 2026
* Release prep for v0.12.1 Moves the project version, CHANGELOG, README status, Python package version and the example kit.conf to 0.12.1. The release carries the headless offscreen fix for builds without EGL (#128); no ABI change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LYNeunMSrWW3U3RS97BYKD * Pin the v0.12.1 libraries in the Python binding Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LYNeunMSrWW3U3RS97BYKD --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Where a build has no EGL (Windows, macOS), a headless engine falls back to a hidden SDL3 window. Until now it drew into that window's own framebuffer, which caused three problems:
strata_resizecould come back black, because the hidden window's size changes asynchronously and follows display scaling;With this change, the hidden window natively only holds the GL context:
strata_resizesets that size;poll_eventreturns only injected events;presentdoes nothing.Browsers keep drawing the hidden canvas directly. The ABI is unchanged.
Changes
src/platform/sdl_surface.cpp: the non-EGL headless path renders offscreen, ignores the hidden window's own events and has a no-op present.include/strata/strata.h,ARCHITECTURE.md: the headless surface contract is documented for both paths.examples/embed-offscreen: a plain-C host that draws into its own buffer with injected input. It is registered as thestrata-embed-offscreentest (--check) and exits with 77 (skipped) where no headless surface can be created.CHANGELOG.md: Unreleased entry.Testing
strata-embed-offscreen --checkpasses on EGL and on the stand-in for a non-EGL build (SDL's offscreen video driver). Before this change it failed six checks on the stand-in.tex_globe_sunis the known local Mesa 21 difference.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeunMSrWW3U3RS97BYKD