MCPcopy Index your code
hub / github.com/gre/gl-react / _prepareGLObjects

Method _prepareGLObjects

packages/gl-react/src/Node.tsx:527–545  ·  view source on GitHub ↗
(gl: WebGLRenderingContext)

Source from the content-addressed store, hash-verified

525 }
526
527 _prepareGLObjects(gl: WebGLRenderingContext): void {
528 const [width, height] = this.getGLSize();
529 const { glParent, glSurface } = this.context;
530 if (glParent === glSurface) {
531 invariant(
532 !this.drawProps.backbuffering,
533 "`backbuffering` is currently not supported for a Root Node. " +
534 "Try to wrap %s in a <LinearCopy> or <NearestCopy>.",
535 this.getGLName()
536 );
537 } else {
538 const fbo = createFBO(gl, width, height);
539 this.framebuffer = fbo;
540 if (this.drawProps.backbuffering) {
541 const fbo = createFBO(gl, width, height);
542 this.backbuffer = fbo;
543 }
544 }
545 }
546
547 _onContextLost(): void {
548 this.dependencies.forEach((d) => d._onContextLost());

Callers 2

componentDidMountMethod · 0.95
_onContextRestoredMethod · 0.95

Calls 3

getGLSizeMethod · 0.95
getGLNameMethod · 0.95
createFBOFunction · 0.85

Tested by

no test coverage detected