triangle.lisp → WebGL

The WebGL hello world: this triangle is drawn by a Lisp program compiled to WebAssembly. Lisp compiles the shaders (the GLSL lives in the Lisp source), links the program and issues the draw call through ten rontolisp:wasm-import host functions — one line of JavaScript each. There is no frame loop and no exports: the page calls _initialize() and the triangle is there.

source · next step: webgl-cube (3D: matrices in Lisp) · then: webgl-galaxy (a full pipeline)