outsource async fetching

This commit is contained in:
Emile Clark-Boman 2026-02-02 05:02:18 +10:00
parent 618a3aec23
commit 1683d2bbe9
3 changed files with 42 additions and 30 deletions

View file

@ -127,9 +127,9 @@ class Smc {
setProgram(delegate) {
const builder = new SmcProgramBuilder(this.#gl, this.raiseError);
delegate(builder); // i pray js passes by ref well...
var result = delegate(builder);
this.#program = builder.build();
this.#program = result.build();
if (!this.#gl.getProgramParameter(this.#program, this.#gl.LINK_STATUS)) {
const infoLog = this.#gl.getProgramInfoLog(this.#program);
this.raiseError(