-
-
Notifications
You must be signed in to change notification settings - Fork 4
graphics
Until a smart way is found to write directly to the WebView canvas, the native Angle runtime ships with a low overhead graphics adapter (using SDL) for fast fullscreen painting:
The only interfacing wasm imports are currently init_graphics(size,width)
and paint(address)
to push the raw image
data to the window surface. These functions might be slightly more comprehensive in the future and allow for two-way
requests to change the graphics configuration, but for now this seems sufficient and the ultra bare metal approach
guarantees high speed and small footprint.
naturally, the data should be of length and format height×width×4bytes (RGBA)
The browsers Angle runtime expects the same interface. If not used these two imports can be turned into an empty shim in custom environments:
let nop_ = x=>x
imports={env:{init_graphics:nop_,paint:nop_}}