Skip to content

graphics

Pannous edited this page Dec 19, 2022 · 9 revisions

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_}}

https://schellingb.github.io/ClangWasm/WebGL/loader.html

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally