MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / renderLoop

Function renderLoop

src/tools/texture-lab/TextureLab.jsx:507–521  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

505 await new Promise(resolve => setTimeout(resolve, 50));
506
507 const renderLoop = () => {
508 currentRenderer.updateVideoFrame(currentVideo);
509 currentRenderer.render(effects, seed, currentVideo.videoWidth, currentVideo.videoHeight);
510
511 const progress = Math.round((currentVideo.currentTime / videoDuration) * 100);
512 setState(s => ({
513 ...s,
514 exportProgress: Math.min(progress, 100),
515 exportStatus: 'Exporting...'
516 }));
517
518 if (!currentVideo.ended && !currentVideo.paused) {
519 animationId = requestAnimationFrame(renderLoop);
520 }
521 };
522
523 animationId = requestAnimationFrame(renderLoop);
524

Callers

nothing calls this directly

Calls 2

updateVideoFrameMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected