dispose method

void dispose(
  1. RenderingContext gl
)

Releases all GPU resources and resets the texture state.

This method should be called when the order texture is no longer needed to prevent memory leaks. After disposal, the object can be reused by calling uploadFull with new data.

Implementation

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