1 | import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
2 | import _createClass from "@babel/runtime/helpers/createClass";
|
3 | import { gl } from '@antv/g-webgpu-core';
|
4 | import { dataTypeMap, usageMap } from './constants';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | var ReglElements = function () {
|
10 | function ReglElements(reGl, options) {
|
11 | _classCallCheck(this, ReglElements);
|
12 |
|
13 | this.elements = void 0;
|
14 | var data = options.data,
|
15 | usage = options.usage,
|
16 | type = options.type,
|
17 | count = options.count;
|
18 | this.elements = reGl.elements({
|
19 | data: data,
|
20 | usage: usageMap[usage || gl.STATIC_DRAW],
|
21 | type: dataTypeMap[type || gl.UNSIGNED_BYTE],
|
22 | count: count
|
23 | });
|
24 | }
|
25 |
|
26 | _createClass(ReglElements, [{
|
27 | key: "get",
|
28 | value: function get() {
|
29 | return this.elements;
|
30 | }
|
31 | }, {
|
32 | key: "subData",
|
33 | value: function subData(_ref) {
|
34 | var data = _ref.data;
|
35 | this.elements.subdata(data);
|
36 | }
|
37 | }, {
|
38 | key: "destroy",
|
39 | value: function destroy() {
|
40 | this.elements.destroy();
|
41 | }
|
42 | }]);
|
43 |
|
44 | return ReglElements;
|
45 | }();
|
46 |
|
47 | export { ReglElements as default };
|
48 |
|
\ | No newline at end of file |