14 lines
359 B
JavaScript
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 ""
|
|
}
|