dispose method

void dispose(
  1. RenderingContext gl
)

Releases all GPU resources and resets the state.

This method should be called when the splat data is no longer needed to prevent memory leaks. After calling dispose, the object can be reused by calling upload with new data.

Implementation

void dispose(RenderingContext gl) {
  _scratch = null;
  if (texture != null) {
    try {
      gl.deleteTexture(texture!);
    } catch (_) {}
    texture = null;
  }
  splatCount = 0;
  texHeight = 0;
}