MCPcopy
hub / github.com/gre/gl-react / _destroyGL

Method _destroyGL

packages/gl-react/src/createSurface.tsx:315–335  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313 };
314
315 _destroyGL() {
316 const { gl } = this;
317 if (gl) {
318 this.gl = null;
319 if (this._emptyTexture) {
320 gl.deleteTexture(this._emptyTexture);
321 this._emptyTexture = null;
322 }
323 if (this.loaderResolver) {
324 this.loaderResolver.dispose();
325 }
326 for (let k in this.shaders) {
327 this.shaders[k].dispose();
328 }
329 this.shaders = {};
330 gl.deleteBuffer(this.buffer);
331 this.getVisitors().map((v) =>
332 v.onSurfaceGLContextChange(this as any, null)
333 );
334 }
335 }
336
337 _prepareGL(
338 gl: WebGLRenderingContext,

Callers 3

componentWillUnmountMethod · 0.95
rebootForDebugMethod · 0.95
SurfaceClass · 0.95

Calls 3

getVisitorsMethod · 0.95
disposeMethod · 0.65

Tested by

no test coverage detected