nativeHardwareTexture.js 598 B

123456789101112131415161718192021222324
  1. /** @internal */
  2. export class NativeHardwareTexture {
  3. get underlyingResource() {
  4. return this._nativeTexture;
  5. }
  6. constructor(existingTexture, engine) {
  7. this._engine = engine;
  8. this.set(existingTexture);
  9. }
  10. setUsage() { }
  11. set(hardwareTexture) {
  12. this._nativeTexture = hardwareTexture;
  13. }
  14. reset() {
  15. this._nativeTexture = null;
  16. }
  17. release() {
  18. if (this._nativeTexture) {
  19. this._engine.deleteTexture(this._nativeTexture);
  20. }
  21. this.reset();
  22. }
  23. }
  24. //# sourceMappingURL=nativeHardwareTexture.js.map