| 1234567891011121314151617181920212223242526272829303132333435 |
- import { coordinates } from "./coordinates.js";
- import { render_engine } from "./render-engine.js"
- class scene {
- #canvas;
- #position;
- #engine;
- constructor() {
- this.#position = new coordinates();
- this.#canvas = document.createElement("canvas");
- const context = this.#canvas.getContext("webgl2");
- if (!context) {
- throw new TypeError("Browser does not support WebGL.");
- }
- this.#engine = new render_engine(this.#canvas, context);
- this.#canvas.classList.add("space-render");
- }
- get position() {
- return this.#position;
- }
- get canvas() {
- return this.#canvas;
- }
- run() {
- this.#engine.run();
- }
- }
- export { scene };
|