implement PPTY
This commit is contained in:
parent
a13032c76e
commit
d76ac04531
12 changed files with 499 additions and 118 deletions
|
|
@ -1,4 +1,14 @@
|
|||
import { Smc } from "./smc.js";
|
||||
import { SmcErr } from "./errors.js";
|
||||
|
||||
export { Smc, SmcErr };
|
||||
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 ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,10 +164,11 @@ class Smc {
|
|||
var delta = time - this.#prevTimeMs;
|
||||
this.render(time, delta);
|
||||
|
||||
setTimeout(
|
||||
() => requestAnimationFrame(this.renderLoop),
|
||||
Math.max(0, delta - this.#minDeltaTimeMs)
|
||||
);
|
||||
requestAnimationFrame(this.renderLoop);
|
||||
// setTimeout(
|
||||
// () => requestAnimationFrame(this.renderLoop),
|
||||
// Math.max(0, delta - this.#minDeltaTimeMs)
|
||||
// );
|
||||
this.#prevTimeMs = time;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue