MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / onWindowResize

Function onWindowResize

apps/baseai.dev/src/components/home/webgl.tsx:466–486  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

464 updateCameraPosition();
465
466 const onWindowResize = () => {
467 const width = window.innerWidth;
468 const height = window.innerHeight;
469
470 camera.aspect = width / height;
471 camera.updateProjectionMatrix();
472 renderer.setSize(width, height);
473
474 if (material.uniforms) {
475 material.uniforms.u_resolution.value.set(width, height);
476 }
477
478 updateCameraPosition();
479
480 createHighResBackgroundTexture(width, height).then(texture => {
481 scene.background = texture;
482 if (material.uniforms && material.uniforms.u_background) {
483 material.uniforms.u_background.value = texture;
484 }
485 });
486 };
487
488 window.addEventListener('resize', onWindowResize);
489

Callers

nothing calls this directly

Calls 2

updateCameraPositionFunction · 0.70

Tested by

no test coverage detected