@antv/l7-renderer 2.21.0 → 2.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/es/device/DeviceAttribute.js +26 -32
  2. package/es/device/DeviceBuffer.js +31 -49
  3. package/es/device/DeviceCache.js +136 -170
  4. package/es/device/DeviceElements.js +32 -38
  5. package/es/device/DeviceFramebuffer.js +76 -104
  6. package/es/device/DeviceModel.js +358 -384
  7. package/es/device/DeviceTexture2D.js +103 -122
  8. package/es/device/constants.js +117 -34
  9. package/es/device/index.js +254 -381
  10. package/es/device/utils/HashMap.js +71 -138
  11. package/es/device/utils/pipeline.js +6 -1
  12. package/es/device/utils/typedarray.js +23 -24
  13. package/es/device/utils/webgl.js +7 -6
  14. package/es/index.js +5 -4
  15. package/es/regl/ReglAttribute.js +17 -33
  16. package/es/regl/ReglBuffer.js +25 -40
  17. package/es/regl/ReglElements.js +21 -36
  18. package/es/regl/ReglFramebuffer.js +24 -44
  19. package/es/regl/ReglModel.js +266 -306
  20. package/es/regl/ReglRenderbuffer.js +19 -36
  21. package/es/regl/ReglTexture2D.js +72 -103
  22. package/es/regl/constants.js +133 -21
  23. package/es/regl/index.js +205 -290
  24. package/lib/device/DeviceAttribute.d.ts +13 -0
  25. package/lib/device/DeviceBuffer.d.ts +18 -0
  26. package/lib/device/DeviceCache.d.ts +14 -0
  27. package/lib/device/DeviceElements.d.ts +13 -0
  28. package/lib/device/DeviceFramebuffer.d.ts +24 -0
  29. package/lib/device/DeviceModel.d.ts +53 -0
  30. package/lib/device/DeviceModel.js +22 -15
  31. package/lib/device/DeviceTexture2D.d.ts +23 -0
  32. package/lib/device/constants.d.ts +35 -0
  33. package/lib/device/index.d.ts +68 -0
  34. package/lib/device/index.js +58 -36
  35. package/lib/device/utils/HashMap.d.ts +24 -0
  36. package/lib/device/utils/pipeline.d.ts +1 -0
  37. package/lib/device/utils/typedarray.d.ts +7 -0
  38. package/lib/device/utils/webgl.d.ts +1 -0
  39. package/lib/index.d.ts +6 -0
  40. package/lib/regl/ReglAttribute.d.ts +16 -0
  41. package/lib/regl/ReglBuffer.d.ts +17 -0
  42. package/lib/regl/ReglElements.d.ts +14 -0
  43. package/lib/regl/ReglFramebuffer.d.ts +16 -0
  44. package/lib/regl/ReglModel.d.ts +46 -0
  45. package/lib/regl/ReglModel.js +21 -11
  46. package/lib/regl/ReglRenderbuffer.d.ts +16 -0
  47. package/lib/regl/ReglTexture2D.d.ts +22 -0
  48. package/lib/regl/constants.d.ts +43 -0
  49. package/lib/regl/index.d.ts +56 -0
  50. package/lib/regl/index.js +70 -48
  51. package/package.json +14 -18
  52. package/CHANGELOG.md +0 -350
  53. package/LICENSE.md +0 -21
@@ -1,153 +1,86 @@
1
- import _createClass from "@babel/runtime/helpers/esm/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
- // Jenkins One-at-a-Time hash from http://www.burtleburtle.net/bob/hash/doobs.html
9
- export function hashCodeNumberUpdate(hash) {
10
- var v = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1
+ // src/device/utils/HashMap.ts
2
+ function hashCodeNumberUpdate(hash, v = 0) {
11
3
  hash += v;
12
4
  hash += hash << 10;
13
5
  hash += hash >>> 6;
14
6
  return hash >>> 0;
15
7
  }
16
- export function hashCodeNumberFinish(hash) {
8
+ function hashCodeNumberFinish(hash) {
17
9
  hash += hash << 3;
18
10
  hash ^= hash >>> 11;
19
11
  hash += hash << 15;
20
12
  return hash >>> 0;
21
13
  }
22
-
23
- // Pass this as a hash function to use a one-bucket HashMap (equivalent to linear search in an array),
24
- // which can be efficient for small numbers of items.
25
- export function nullHashFunc() {
14
+ function nullHashFunc() {
26
15
  return 0;
27
16
  }
28
- var HashBucket = /*#__PURE__*/_createClass(function HashBucket() {
29
- _classCallCheck(this, HashBucket);
30
- _defineProperty(this, "keys", []);
31
- _defineProperty(this, "values", []);
32
- });
33
- export var HashMap = /*#__PURE__*/function () {
34
- function HashMap(keyEqualFunc, keyHashFunc) {
35
- _classCallCheck(this, HashMap);
36
- _defineProperty(this, "buckets", new Map());
17
+ var HashBucket = class {
18
+ constructor() {
19
+ this.keys = [];
20
+ this.values = [];
21
+ }
22
+ };
23
+ var HashMap = class {
24
+ constructor(keyEqualFunc, keyHashFunc) {
37
25
  this.keyEqualFunc = keyEqualFunc;
38
26
  this.keyHashFunc = keyHashFunc;
27
+ this.buckets = /* @__PURE__ */ new Map();
28
+ }
29
+ findBucketIndex(bucket, k) {
30
+ for (let i = 0; i < bucket.keys.length; i++)
31
+ if (this.keyEqualFunc(k, bucket.keys[i]))
32
+ return i;
33
+ return -1;
34
+ }
35
+ findBucket(k) {
36
+ const bw = this.keyHashFunc(k);
37
+ return this.buckets.get(bw);
38
+ }
39
+ get(k) {
40
+ const bucket = this.findBucket(k);
41
+ if (bucket === void 0)
42
+ return null;
43
+ const bi = this.findBucketIndex(bucket, k);
44
+ if (bi < 0)
45
+ return null;
46
+ return bucket.values[bi];
47
+ }
48
+ add(k, v) {
49
+ const bw = this.keyHashFunc(k);
50
+ if (this.buckets.get(bw) === void 0)
51
+ this.buckets.set(bw, new HashBucket());
52
+ const bucket = this.buckets.get(bw);
53
+ bucket.keys.push(k);
54
+ bucket.values.push(v);
55
+ }
56
+ delete(k) {
57
+ const bucket = this.findBucket(k);
58
+ if (bucket === void 0)
59
+ return;
60
+ const bi = this.findBucketIndex(bucket, k);
61
+ if (bi === -1)
62
+ return;
63
+ bucket.keys.splice(bi, 1);
64
+ bucket.values.splice(bi, 1);
65
+ }
66
+ clear() {
67
+ this.buckets.clear();
68
+ }
69
+ size() {
70
+ let acc = 0;
71
+ for (const bucket of this.buckets.values())
72
+ acc += bucket.values.length;
73
+ return acc;
74
+ }
75
+ *values() {
76
+ for (const bucket of this.buckets.values())
77
+ for (let j = bucket.values.length - 1; j >= 0; j--)
78
+ yield bucket.values[j];
39
79
  }
40
- _createClass(HashMap, [{
41
- key: "findBucketIndex",
42
- value: function findBucketIndex(bucket, k) {
43
- for (var i = 0; i < bucket.keys.length; i++) if (this.keyEqualFunc(k, bucket.keys[i])) return i;
44
- return -1;
45
- }
46
- }, {
47
- key: "findBucket",
48
- value: function findBucket(k) {
49
- var bw = this.keyHashFunc(k);
50
- return this.buckets.get(bw);
51
- }
52
- }, {
53
- key: "get",
54
- value: function get(k) {
55
- var bucket = this.findBucket(k);
56
- if (bucket === undefined) return null;
57
- var bi = this.findBucketIndex(bucket, k);
58
- if (bi < 0) return null;
59
- return bucket.values[bi];
60
- }
61
- }, {
62
- key: "add",
63
- value: function add(k, v) {
64
- var bw = this.keyHashFunc(k);
65
- if (this.buckets.get(bw) === undefined) this.buckets.set(bw, new HashBucket());
66
- var bucket = this.buckets.get(bw);
67
- bucket.keys.push(k);
68
- bucket.values.push(v);
69
- }
70
- }, {
71
- key: "delete",
72
- value: function _delete(k) {
73
- var bucket = this.findBucket(k);
74
- if (bucket === undefined) return;
75
- var bi = this.findBucketIndex(bucket, k);
76
- if (bi === -1) return;
77
- bucket.keys.splice(bi, 1);
78
- bucket.values.splice(bi, 1);
79
- }
80
- }, {
81
- key: "clear",
82
- value: function clear() {
83
- this.buckets.clear();
84
- }
85
- }, {
86
- key: "size",
87
- value: function size() {
88
- var acc = 0;
89
- var _iterator = _createForOfIteratorHelper(this.buckets.values()),
90
- _step;
91
- try {
92
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
93
- var bucket = _step.value;
94
- acc += bucket.values.length;
95
- }
96
- } catch (err) {
97
- _iterator.e(err);
98
- } finally {
99
- _iterator.f();
100
- }
101
- return acc;
102
- }
103
- }, {
104
- key: "values",
105
- value: /*#__PURE__*/_regeneratorRuntime.mark(function values() {
106
- var _iterator2, _step2, bucket, j;
107
- return _regeneratorRuntime.wrap(function values$(_context) {
108
- while (1) switch (_context.prev = _context.next) {
109
- case 0:
110
- _iterator2 = _createForOfIteratorHelper(this.buckets.values());
111
- _context.prev = 1;
112
- _iterator2.s();
113
- case 3:
114
- if ((_step2 = _iterator2.n()).done) {
115
- _context.next = 14;
116
- break;
117
- }
118
- bucket = _step2.value;
119
- j = bucket.values.length - 1;
120
- case 6:
121
- if (!(j >= 0)) {
122
- _context.next = 12;
123
- break;
124
- }
125
- _context.next = 9;
126
- return bucket.values[j];
127
- case 9:
128
- j--;
129
- _context.next = 6;
130
- break;
131
- case 12:
132
- _context.next = 3;
133
- break;
134
- case 14:
135
- _context.next = 19;
136
- break;
137
- case 16:
138
- _context.prev = 16;
139
- _context.t0 = _context["catch"](1);
140
- _iterator2.e(_context.t0);
141
- case 19:
142
- _context.prev = 19;
143
- _iterator2.f();
144
- return _context.finish(19);
145
- case 22:
146
- case "end":
147
- return _context.stop();
148
- }
149
- }, values, this, [[1, 16, 19, 22]]);
150
- })
151
- }]);
152
- return HashMap;
153
- }();
80
+ };
81
+ export {
82
+ HashMap,
83
+ hashCodeNumberFinish,
84
+ hashCodeNumberUpdate,
85
+ nullHashFunc
86
+ };
@@ -1 +1,6 @@
1
- export function pipelineEquals() {}
1
+ // src/device/utils/pipeline.ts
2
+ function pipelineEquals() {
3
+ }
4
+ export {
5
+ pipelineEquals
6
+ };
@@ -1,34 +1,33 @@
1
+ // src/device/utils/typedarray.ts
1
2
  var dtypes = {
2
- '[object Int8Array]': 5120,
3
- '[object Int16Array]': 5122,
4
- '[object Int32Array]': 5124,
5
- '[object Uint8Array]': 5121,
6
- '[object Uint8ClampedArray]': 5121,
7
- '[object Uint16Array]': 5123,
8
- '[object Uint32Array]': 5125,
9
- '[object Float32Array]': 5126,
10
- '[object Float64Array]': 5121,
11
- '[object ArrayBuffer]': 5121
3
+ "[object Int8Array]": 5120,
4
+ "[object Int16Array]": 5122,
5
+ "[object Int32Array]": 5124,
6
+ "[object Uint8Array]": 5121,
7
+ "[object Uint8ClampedArray]": 5121,
8
+ "[object Uint16Array]": 5123,
9
+ "[object Uint32Array]": 5125,
10
+ "[object Float32Array]": 5126,
11
+ "[object Float64Array]": 5121,
12
+ "[object ArrayBuffer]": 5121
12
13
  };
13
- // eslint-disable-next-line
14
- export function isTypedArray(x) {
14
+ function isTypedArray(x) {
15
15
  return Object.prototype.toString.call(x) in dtypes;
16
16
  }
17
-
18
- /**
19
- * WebGPU does not support RGB texture, so we need to convert RGB to RGBA
20
- * @see https://github.com/antvis/L7/pull/2262
21
- */
22
- export function extend3ChannelsTo4(array, valueToInsert) {
23
- var originalLength = array.length;
24
- var insertCount = Math.ceil(originalLength / 3);
25
- var newLength = originalLength + insertCount;
26
- var newArray = new Float32Array(newLength);
27
- for (var i = 0; i < newLength; i += 4) {
17
+ function extend3ChannelsTo4(array, valueToInsert) {
18
+ const originalLength = array.length;
19
+ const insertCount = Math.ceil(originalLength / 3);
20
+ const newLength = originalLength + insertCount;
21
+ const newArray = new Float32Array(newLength);
22
+ for (let i = 0; i < newLength; i += 4) {
28
23
  newArray[i] = array[i / 4 * 3];
29
24
  newArray[i + 1] = array[i / 4 * 3 + 1];
30
25
  newArray[i + 2] = array[i / 4 * 3 + 2];
31
26
  newArray[i + 3] = valueToInsert;
32
27
  }
33
28
  return newArray;
34
- }
29
+ }
30
+ export {
31
+ extend3ChannelsTo4,
32
+ isTypedArray
33
+ };
@@ -1,9 +1,10 @@
1
- // @see https://github.com/visgl/luma.gl/blob/30a1039573576d73641de7c1ba222e8992eb526e/modules/gltools/src/utils/webgl-checks.ts#L22
2
- export function isWebGL2(gl) {
3
- if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {
1
+ // src/device/utils/webgl.ts
2
+ function isWebGL2(gl) {
3
+ if (typeof WebGL2RenderingContext !== "undefined" && gl instanceof WebGL2RenderingContext) {
4
4
  return true;
5
5
  }
6
- // Look for debug contexts, headless gl etc
7
- // @ts-ignore
8
6
  return Boolean(gl && gl._version === 2);
9
- }
7
+ }
8
+ export {
9
+ isWebGL2
10
+ };
package/es/index.js CHANGED
@@ -1,6 +1,7 @@
1
- /**
2
- *
3
- */
1
+ // src/index.ts
4
2
  import DeviceRendererService from "./device";
5
3
  import ReglRendererService from "./regl";
6
- export { DeviceRendererService, ReglRendererService };
4
+ export {
5
+ DeviceRendererService,
6
+ ReglRendererService
7
+ };
@@ -1,17 +1,7 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- /**
4
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes
5
- */
6
- var ReglAttribute = /*#__PURE__*/function () {
7
- function ReglAttribute(gl, options) {
8
- _classCallCheck(this, ReglAttribute);
9
- var buffer = options.buffer,
10
- offset = options.offset,
11
- stride = options.stride,
12
- normalized = options.normalized,
13
- size = options.size,
14
- divisor = options.divisor;
1
+ // src/regl/ReglAttribute.ts
2
+ var ReglAttribute = class {
3
+ constructor(gl, options) {
4
+ const { buffer, offset, stride, normalized, size, divisor } = options;
15
5
  this.buffer = buffer;
16
6
  this.attribute = {
17
7
  buffer: buffer.get(),
@@ -24,22 +14,16 @@ var ReglAttribute = /*#__PURE__*/function () {
24
14
  this.attribute.size = size;
25
15
  }
26
16
  }
27
- _createClass(ReglAttribute, [{
28
- key: "get",
29
- value: function get() {
30
- return this.attribute;
31
- }
32
- }, {
33
- key: "updateBuffer",
34
- value: function updateBuffer(options) {
35
- this.buffer.subData(options);
36
- }
37
- }, {
38
- key: "destroy",
39
- value: function destroy() {
40
- this.buffer.destroy();
41
- }
42
- }]);
43
- return ReglAttribute;
44
- }();
45
- export { ReglAttribute as default };
17
+ get() {
18
+ return this.attribute;
19
+ }
20
+ updateBuffer(options) {
21
+ this.buffer.subData(options);
22
+ }
23
+ destroy() {
24
+ this.buffer.destroy();
25
+ }
26
+ };
27
+ export {
28
+ ReglAttribute as default
29
+ };
@@ -1,48 +1,33 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
- import { gl } from '@antv/l7-core';
1
+ // src/regl/ReglBuffer.ts
2
+ import { gl } from "@antv/l7-core";
5
3
  import { dataTypeMap, usageMap } from "./constants";
6
-
7
- /**
8
- * adaptor for regl.Buffer
9
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers
10
- */
11
- var ReglBuffer = /*#__PURE__*/function () {
12
- function ReglBuffer(reGl, options) {
13
- _classCallCheck(this, ReglBuffer);
14
- _defineProperty(this, "isDestroyed", false);
15
- var data = options.data,
16
- usage = options.usage,
17
- type = options.type;
4
+ var ReglBuffer = class {
5
+ constructor(reGl, options) {
6
+ this.isDestroyed = false;
7
+ const { data, usage, type } = options;
18
8
  this.buffer = reGl.buffer({
19
- data: data,
9
+ data,
20
10
  usage: usageMap[usage || gl.STATIC_DRAW],
21
11
  type: dataTypeMap[type || gl.UNSIGNED_BYTE]
22
12
  // length: 0,
23
13
  });
24
14
  }
25
- _createClass(ReglBuffer, [{
26
- key: "get",
27
- value: function get() {
28
- return this.buffer;
29
- }
30
- }, {
31
- key: "destroy",
32
- value: function destroy() {
33
- if (!this.isDestroyed) {
34
- this.buffer.destroy();
35
- }
36
- this.isDestroyed = true;
37
- }
38
- }, {
39
- key: "subData",
40
- value: function subData(_ref) {
41
- var data = _ref.data,
42
- offset = _ref.offset;
43
- this.buffer.subdata(data, offset);
15
+ get() {
16
+ return this.buffer;
17
+ }
18
+ destroy() {
19
+ if (!this.isDestroyed) {
20
+ this.buffer.destroy();
44
21
  }
45
- }]);
46
- return ReglBuffer;
47
- }();
48
- export { ReglBuffer as default };
22
+ this.isDestroyed = true;
23
+ }
24
+ subData({
25
+ data,
26
+ offset
27
+ }) {
28
+ this.buffer.subdata(data, offset);
29
+ }
30
+ };
31
+ export {
32
+ ReglBuffer as default
33
+ };
@@ -1,42 +1,27 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import { gl } from '@antv/l7-core';
1
+ // src/regl/ReglElements.ts
2
+ import { gl } from "@antv/l7-core";
4
3
  import { dataTypeMap, usageMap } from "./constants";
5
-
6
- /**
7
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements
8
- */
9
- var ReglElements = /*#__PURE__*/function () {
10
- function ReglElements(reGl, options) {
11
- _classCallCheck(this, ReglElements);
12
- var data = options.data,
13
- usage = options.usage,
14
- type = options.type,
15
- count = options.count;
4
+ var ReglElements = class {
5
+ constructor(reGl, options) {
6
+ const { data, usage, type, count } = options;
16
7
  this.elements = reGl.elements({
17
- data: data,
8
+ data,
18
9
  usage: usageMap[usage || gl.STATIC_DRAW],
19
10
  type: dataTypeMap[type || gl.UNSIGNED_BYTE],
20
- count: count
11
+ count
21
12
  });
22
13
  }
23
- _createClass(ReglElements, [{
24
- key: "get",
25
- value: function get() {
26
- return this.elements;
27
- }
28
- }, {
29
- key: "subData",
30
- value: function subData(_ref) {
31
- var data = _ref.data;
32
- this.elements.subdata(data);
33
- }
34
- }, {
35
- key: "destroy",
36
- value: function destroy() {
37
- // this.elements.destroy();
38
- }
39
- }]);
40
- return ReglElements;
41
- }();
42
- export { ReglElements as default };
14
+ get() {
15
+ return this.elements;
16
+ }
17
+ subData({
18
+ data
19
+ }) {
20
+ this.elements.subdata(data);
21
+ }
22
+ destroy() {
23
+ }
24
+ };
25
+ export {
26
+ ReglElements as default
27
+ };
@@ -1,51 +1,31 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- /**
4
- * adaptor for regl.Framebuffer
5
- * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
6
- */
7
- var ReglFramebuffer = /*#__PURE__*/function () {
8
- function ReglFramebuffer(reGl, options) {
9
- _classCallCheck(this, ReglFramebuffer);
10
- var width = options.width,
11
- height = options.height,
12
- color = options.color,
13
- colors = options.colors;
14
- var framebufferOptions = {
15
- width: width,
16
- height: height
1
+ // src/regl/ReglFramebuffer.ts
2
+ var ReglFramebuffer = class {
3
+ constructor(reGl, options) {
4
+ const { width, height, color, colors } = options;
5
+ const framebufferOptions = {
6
+ width,
7
+ height
17
8
  };
18
9
  if (Array.isArray(colors)) {
19
- framebufferOptions.colors = colors.map(function (c) {
20
- return c.get();
21
- });
10
+ framebufferOptions.colors = colors.map(
11
+ (c) => c.get()
12
+ );
22
13
  }
23
- if (color && typeof color !== 'boolean') {
14
+ if (color && typeof color !== "boolean") {
24
15
  framebufferOptions.color = color.get();
25
16
  }
26
-
27
- // TODO: depth & stencil
28
-
29
17
  this.framebuffer = reGl.framebuffer(framebufferOptions);
30
18
  }
31
- _createClass(ReglFramebuffer, [{
32
- key: "get",
33
- value: function get() {
34
- return this.framebuffer;
35
- }
36
- }, {
37
- key: "destroy",
38
- value: function destroy() {
39
- this.framebuffer.destroy();
40
- }
41
- }, {
42
- key: "resize",
43
- value: function resize(_ref) {
44
- var width = _ref.width,
45
- height = _ref.height;
46
- this.framebuffer.resize(width, height);
47
- }
48
- }]);
49
- return ReglFramebuffer;
50
- }();
51
- export { ReglFramebuffer as default };
19
+ get() {
20
+ return this.framebuffer;
21
+ }
22
+ destroy() {
23
+ this.framebuffer.destroy();
24
+ }
25
+ resize({ width, height }) {
26
+ this.framebuffer.resize(width, height);
27
+ }
28
+ };
29
+ export {
30
+ ReglFramebuffer as default
31
+ };