onTextureDispose method

dynamic onTextureDispose(
  1. dynamic event
)

Implementation

onTextureDispose(event) {
  var texture = event.target;

  texture.removeEventListener('dispose', onTextureDispose);

  var cubemap = cubemaps.get(texture);

  if (cubemap != null) {
    cubemaps.delete(texture);
    cubemap.dispose();
  }
}