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