UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 529 B
import{releaseMaybe as e,isSome as t}from"../../../../../core/maybe.js";import{isPromiseLike as s}from"../../../../../core/promiseUtils.js";class r{constructor(t,r){this._textureRep=t,this.loadPromise=null,this._disposed=!1;const i=this._textureRep.acquire(r);s(i)?(i.then((t=>{this._disposed?e(t):this._textureRef=t})),this.loadPromise=i):this._textureRef=i}dispose(){this._textureRef=e(this._textureRef),this._disposed=!0}get glTexture(){return t(this._textureRef)?this._textureRef.glTexture:null}}export{r as RenderTexture};