How to use the gl-react.TextureLoaders.add function in gl-react

To help you get started, we’ve selected a few gl-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gre / gl-react / tests / utils.js View on Github external
this.textures.forEach(t => gl.deleteTexture(t));
  }
  canLoad (input: any) {
    return input instanceof FakeTexture;
  }
  get (ft: FakeTexture) {
    const array = ft.getPixels();
    if (array) {
      const t = createNDArrayTexture(this.gl, array);
      this.textures.push(t);
      return t;
    }
  }
}

TextureLoaders.add(FakeTextureLoader);
github gre / gl-react / packages / gl-react-dom / src / legacy.js View on Github external
}
  get(obj: any) {
    return super.get(obj.uri);
  }
  getSize(obj: any) {
    return super.getSize(obj.uri);
  }
  load(obj: any) {
    console.warn(
      "gl-react-dom: usage of {uri} format in texture uniform is deprecated. Directly give an image URL instead."
    );
    return super.load(obj.uri);
  }
}

TextureLoaders.add(DeprecatedUriImageTextureLoader);