more rendering code, not much changes, beginning refactor of the rendering API

This commit is contained in:
2026-04-02 06:31:30 +02:00
parent 92418e7e4e
commit 60313f5373
7 changed files with 317 additions and 263 deletions
+37
View File
@@ -0,0 +1,37 @@
namespace WebGEngine {
class Engine {
private _GL: WebGL2RenderingContext;
private _DrawMode: EngineDrawMode = EngineDrawMode.TEXTURE;
constructor(canvas: HTMLCanvasElement) {
let context = canvas.getContext('webgl2');
if (!context) throw new Error(`Failed to get webgl2 context from ${canvas}`);
this._GL = context;
this.init();
}
private init(): void {}
}
enum EngineDrawMode {
TEXTURE = 0,
WIREFRAME = 1,
VERTEX = 2
}
interface ShaderSrc {
type: number,
}
interface EngineConfig {
canvas: HTMLCanvasElement,
vertexShader: string,
fragmentShader: string,
additionalShaders?:
}
}
export default WebGEngine;