Files
aego/docs/web-capabilities.md
T

3.6 KiB

Web capabilities

What the browser build (GOOS=js GOARCH=wasm, platform/web + gpu/webgl2) supports compared with the native build. Decisions: D289, D290.

Platform

Feature Web Notes
Window works one canvas; size from CSS, pixels from devicePixelRatio
Resize, DPI change works ResizeObserver, resize, DPR check every frame
Keyboard works code → scancode; browser shortcuts (Ctrl/Cmd, F5, F11, F12) stay with the browser
Text input degraded single characters only, no IME composition
Mouse works pointer capture while a button is held
Wheel works 100 px = one line; trackpads are precise
Pointer lock degraded granted on the next click or key press after the request
Touch degraded primary pointer as the left button; multi-touch in Stage 18
Gamepads works standard mapping; Chrome reports a pad only after a button press
Focus loss works held keys and buttons are released
Hidden tab works the real clock stops, requestAnimationFrame stops
Frame pacing degraded always VSync; no frame limiter
Fullscreen degraded entered on the next click or key press
Display modes, monitors missing the display module has nothing to apply
Clipboard write works navigator.clipboard.writeText (secure contexts)
Clipboard read degraded only what was pasted into the page or copied by the game
Cursors works CSS cursor names
Drag and drop of files missing
Player profile, saves works localStorage, limited to a few MB; a full store reports a write error
Files outside the bundle missing no OS file system

GPU

Feature Web Notes
Buffers, instancing works
Textures RGBA8, SRGB8_ALPHA8, R8 works
RGBA16F degraded renderable only with EXT_color_buffer_float
Depth24/stencil8 targets works
sRGB output works offscreen backbuffer plus an encoding pass
Samplers, mipmaps works
Scissor, viewport, blend, cull works
ReadPixels works targets only; the canvas is not read back
GPU timer degraded needs EXT_disjoint_timer_query_webgl2, empty otherwise
Debug output, object labels missing Options.Debug checks getError after creation calls
Context loss works objects are recreated from CPU copies; textures cost twice the memory
Shaders works GLSL ES 3.00 copies generated by make shaders

Audio

Feature Web Notes
Output works AudioWorklet at the context's rate: 48 kHz is asked, Safari may give 44.1 kHz and the mixer runs at what it gets
Start degraded silent until the first click, key or touch on the page; a page started by a click (the docs Try it) plays at once; audio written before that is dropped
Mute works web exports show a mute button; the choice is kept in localStorage for the site
Hidden tab works the context is suspended and resumed
Transport works a SharedArrayBuffer ring when the page is cross-origin isolated (COOP same-origin and COEP require-corp), otherwise blocks posted to the worklet
Latency degraded 3 blocks of 512 frames (~32 ms) with SharedArrayBuffer, 6 (~64 ms) with messages, plus the browser's own output buffer
Device events missing the browser follows the default output device itself

Exported games

aego export --target web (D295) runs the same runtime as the desktop export on this platform and GPU backend. Differences from desktop: data is loaded into memory before the game starts, there are no log files or crash bundles, saves and settings share the site's localStorage quota.