35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$buffer$BufferResource = function(global, require, module, exports) {
|
|
global = require("module$node_modules$eventemitter3$index");
|
|
var uid = require("module$node_modules$pixi_DOT_js$lib$utils$data$uid");
|
|
"use strict";
|
|
class BufferResource extends global {
|
|
constructor({buffer, offset, size}) {
|
|
super();
|
|
this.uid = uid.uid("buffer");
|
|
this._resourceType = "bufferResource";
|
|
this._touched = 0;
|
|
this._resourceId = uid.uid("resource");
|
|
this._bufferResource = !0;
|
|
this.destroyed = !1;
|
|
this.buffer = buffer;
|
|
this.offset = offset | 0;
|
|
this.size = size;
|
|
this.buffer.on("change", this.onBufferChange, this);
|
|
}
|
|
onBufferChange() {
|
|
this._resourceId = uid.uid("resource");
|
|
this.emit("change", this);
|
|
}
|
|
destroy(destroyBuffer = !1) {
|
|
this.destroyed = !0;
|
|
destroyBuffer && this.buffer.destroy();
|
|
this.emit("change", this);
|
|
this.buffer = null;
|
|
this.removeAllListeners();
|
|
}
|
|
}
|
|
exports.BufferResource = BufferResource;
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$buffer$BufferResource.js.map
|