Detach the GL context state to a separate module.

This commit is contained in:
2023-02-09 09:50:44 +08:00
parent 4cd5ebb936
commit c494156983
8 changed files with 118 additions and 7 deletions
@@ -1,7 +1,22 @@
import { WebGLCanvas } from "state/WebGLCanvas";
import { WebGLState } from "state/WebGLState";
import type { WebGLCanvasOption } from "state/WebGLCanvas";
type WebGLRendererOption = WebGLCanvasOption;
class WebGLRenderer {
public constructor() {}
public canvas: WebGLCanvas;
public state: WebGLState;
public constructor(option: WebGLRendererOption) {
this.canvas = new WebGLCanvas(option);
this.state = new WebGLState();
this.state.bindCanvas(this.canvas);
}
}
export { WebGLRenderer };