Spaces:
Running
Running
cleanup
Browse files
index.js
CHANGED
@@ -115,7 +115,7 @@ async function main() {
|
|
115 |
],
|
116 |
});
|
117 |
|
118 |
-
function render(time) {
|
119 |
time *= CONFIG.time.phase;
|
120 |
const fov = 60 * Math.PI / 180;
|
121 |
const aspect = canvas.clientWidth / canvas.clientHeight;
|
@@ -135,10 +135,10 @@ async function main() {
|
|
135 |
pass.drawIndexed(numGlyphs * 6);
|
136 |
pass.end();
|
137 |
device.queue.submit([encoder.finish()]);
|
138 |
-
requestAnimationFrame(render);
|
139 |
}
|
140 |
-
|
141 |
-
requestAnimationFrame(render);
|
142 |
}
|
143 |
|
144 |
function generateGlyphVerticesForText(s, COLORS, glyphCanvas) {
|
@@ -196,4 +196,4 @@ function createTextureFromSource(device, source, options = {}) {
|
|
196 |
return texture;
|
197 |
}
|
198 |
|
199 |
-
main();
|
|
|
115 |
],
|
116 |
});
|
117 |
|
118 |
+
function render(time, context, pipeline, uniformBuffer, uniformValues, bindGroup, vertexBuffer, indexBuffer, RENDER_PASS_DESCRIPTOR) {
|
119 |
time *= CONFIG.time.phase;
|
120 |
const fov = 60 * Math.PI / 180;
|
121 |
const aspect = canvas.clientWidth / canvas.clientHeight;
|
|
|
135 |
pass.drawIndexed(numGlyphs * 6);
|
136 |
pass.end();
|
137 |
device.queue.submit([encoder.finish()]);
|
138 |
+
requestAnimationFrame((time) => render(time, context, pipeline, uniformBuffer, uniformValues, bindGroup, vertexBuffer, indexBuffer, RENDER_PASS_DESCRIPTOR));
|
139 |
}
|
140 |
+
|
141 |
+
requestAnimationFrame((time) => render(time, context, pipeline, uniformBuffer, uniformValues, bindGroup, vertexBuffer, indexBuffer, RENDER_PASS_DESCRIPTOR));
|
142 |
}
|
143 |
|
144 |
function generateGlyphVerticesForText(s, COLORS, glyphCanvas) {
|
|
|
196 |
return texture;
|
197 |
}
|
198 |
|
199 |
+
main();
|