Detach the GL context state to a separate module.
This commit is contained in:
@@ -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 };
|
||||
Reference in New Issue
Block a user