- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs
Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
/**
|
|
* adaptor for regl.Framebuffer
|
|
* @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers
|
|
*/
|
|
var ReglFramebuffer = /*#__PURE__*/function () {
|
|
function ReglFramebuffer(reGl, options) {
|
|
_classCallCheck(this, ReglFramebuffer);
|
|
this.framebuffer = void 0;
|
|
var width = options.width,
|
|
height = options.height,
|
|
color = options.color,
|
|
colors = options.colors,
|
|
depth = options.depth,
|
|
stencil = options.stencil;
|
|
var framebufferOptions = {
|
|
width: width,
|
|
height: height
|
|
};
|
|
if (Array.isArray(colors)) {
|
|
framebufferOptions.colors = colors.map(function (c) {
|
|
return c.get();
|
|
});
|
|
}
|
|
if (color && typeof color !== 'boolean') {
|
|
framebufferOptions.color = color.get();
|
|
}
|
|
|
|
// TODO: depth & stencil
|
|
|
|
this.framebuffer = reGl.framebuffer(framebufferOptions);
|
|
}
|
|
_createClass(ReglFramebuffer, [{
|
|
key: "get",
|
|
value: function get() {
|
|
return this.framebuffer;
|
|
}
|
|
}, {
|
|
key: "destroy",
|
|
value: function destroy() {
|
|
this.framebuffer.destroy();
|
|
}
|
|
}, {
|
|
key: "resize",
|
|
value: function resize(_ref) {
|
|
var width = _ref.width,
|
|
height = _ref.height;
|
|
this.framebuffer.resize(width, height);
|
|
}
|
|
}]);
|
|
return ReglFramebuffer;
|
|
}();
|
|
export { ReglFramebuffer as default };
|
|
//# sourceMappingURL=ReglFramebuffer.js.map
|