onTextureDispose method

void onTextureDispose(
  1. dynamic event
)

Implementation

void onTextureDispose(event) {
  final texture = event.target;

  texture.removeEventListener('dispose', onTextureDispose);

  final cubemap = cubemaps.get(texture);

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