node-ejs-renderer/node_modules/three/examples/jsm/renderers/webgl/utils/WebGLExtensions.js
2024-06-09 13:55:01 -04:00

37 lines
481 B
JavaScript

class WebGLExtensions {
constructor( backend ) {
this.backend = backend;
this.gl = this.backend.gl;
this.availableExtensions = this.gl.getSupportedExtensions();
this.extensions = {};
}
get( name ) {
let extension = this.extensions[ name ];
if ( extension === undefined ) {
extension = this.gl.getExtension( name );
}
return extension;
}
has( name ) {
return this.availableExtensions.includes( name );
}
}
export default WebGLExtensions;