site/www/js/smc/lib.js
2026-02-03 20:26:22 +10:00

14 lines
359 B
JavaScript

import { Smc } from "./smc.js";
import { SmcErr } from "./errors.js";
export { Smc, SmcErr, fetchShader };
async function fetchShader(uri, delegate) {
const res = await fetch(uri);
if (res.ok)
return await res.text();
this.raiseError(
SmcErr.FETCH_SHADER,
`Failed to load shader source ${url}: ${res.status} ${res.json()}`);
return ""
}