-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
What is this?
v0.7.0 shipped first-class Electrobun runtime support for gametau. Two example apps now have Electrobun BrowserWindow and GPUWindow (native WGPU) paths:
- electrobun-counter — minimal counter with hybrid DOM + native WGPU surface, and a pure GPUWindow mode
- battlestation — heavier showcase where Three.js
WebGPURendererrenders onto Electrobun's native WGPU surface (viawebgpu.install()+createCanvasShim()) inside a GPUWindow. Electrobun provides the native GPU surface; Three.js still does all scene/geometry/draw calls.
How to test (5 minutes)
Prerequisites
- Bun >= 1.1
- Rust toolchain with
wasm32-unknown-unknowntarget (rustup target add wasm32-unknown-unknown) - wasm-pack (
cargo install wasm-pack) - macOS or Linux
Steps
# 1. Clone and install
git clone https://github.com/devallibus/gametau.git
cd gametau
git checkout v0.7.0
bun install
# 2. Pick an example (start with the counter — it's simpler)
cd examples/electrobun-counter
# 3. Run the hybrid BrowserWindow path (DOM HUD + native WGPU surface)
bun run dev:electrobun:hybrid
# 4. Run the pure GPUWindow path (native only, no DOM)
bun run dev:electrobun:gpu
# 5. (Optional) Try the heavier battlestation example
cd ../battlestation
bun run dev:electrobun:browser
bun run dev:electrobun:gpuWhat to look for
| Path | Expected behavior |
|---|---|
electrobun-counter hybrid |
Browser window opens with HTML buttons (inc/dec/reset). A native WGPU surface should appear embedded below the buttons. Counter value updates in both the DOM and the native surface. |
electrobun-counter gpu |
A native 960x640 window opens. Counter value is shown in the window title, updating every 500ms. No DOM/HTML — pure native. |
battlestation browser |
Same as the web version but running inside an Electrobun BrowserWindow. Full DOM HUD, audio, radar. |
battlestation gpu |
Native 960x960 window. Three.js WebGPURenderer draws onto Electrobun's native WGPU surface (via webgpu.install() + createCanvasShim()). Mission state and score in the title bar. Mouse/keyboard input via Electrobun APIs. No audio, no HTML HUD (intentional — see limitations below). |
Known GPUWindow limitations (by design)
- No HTML HUD overlay in native GPUWindow mode
- No Web Audio playback in native mode yet
- Mission status surfaces through window title + console
- Native title-bar chrome may slightly skew top-edge mouse targeting
How the GPU rendering works
Electrobun does not replace Three.js. Instead:
webgpu.install()injects Electrobun's native WebGPU adapter into the Bun runtime globalswebgpu.utils.createCanvasShim(window)creates a fake canvas backed by the native GpuWindow surface- Three.js
WebGPURendererrenders onto that shim canvas as if it were a browser<canvas> - All scene graph, geometry, and draw calls are still Three.js — Electrobun only provides the native GPU surface
How to report
Please comment on this issue with:
- OS (e.g., macOS 14.3 arm64, Ubuntu 24.04 x86_64)
- Which example you tried (counter / battlestation)
- Which path (hybrid / gpu / browser)
- Result: worked / partially worked / failed
- Screenshot or terminal output if something went wrong
- Electrobun version (
bun node_modules/electrobun/package.json | grep version)
Even a "counter hybrid worked fine on macOS Sonoma" is valuable — it confirms the path for that platform.
Context
- Release: v0.7.0
- Adapter code:
packages/webtau/src/adapters/electrobun.ts(64 unit tests pass via mocks) - GPU rendering bridge:
examples/battlestation/src/game/scene-gpu.ts - All Rust crates and WASM builds verified on Windows — only the actual Electrobun runtime paths need real-device confirmation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed