UNPKG

@awayjs/stage

Version:
50 lines (49 loc) 1.54 kB
var SamplerState = /** @class */ (function () { function SamplerState(id, type) { if (id === void 0) { id = -1; } if (type === void 0) { type = null; } this.id = id; this.type = type; this.wrap = 0; this.filter = 0; this.mipfilter = 0; this.boundedTexture = null; this._dirty = true; } Object.defineProperty(SamplerState.prototype, "valid", { get: function () { return this.type !== null && this.id >= 0; }, enumerable: false, configurable: true }); SamplerState.prototype.set = function (wrap, filter, mipFilter) { this._dirty = this._dirty || (wrap !== wrap) || (filter !== filter) || (mipFilter !== mipFilter); this.wrap = wrap; this.filter = filter; this.mipfilter = mipFilter; return this; }; SamplerState.prototype.equals = function (s) { return (this.type === s.type && this.wrap === s.wrap && this.filter === s.filter && this.mipfilter === s.mipfilter); }; SamplerState.prototype.copyFrom = function (s) { this.type = s.type; this.wrap = s.wrap; this.filter = s.filter; this.mipfilter = s.mipfilter; return this; }; SamplerState.prototype.dispose = function () { this.id = -1; this.type = null; this.wrap = 0; this.filter = 0; this.mipfilter = 0; }; return SamplerState; }()); export { SamplerState };