Flexible architecture with WebGL (OpenGL ES) and WebGPU (Vulkan-like) support
// Create engine
const engine = new GameEngine({
canvas: canvasElement,
rendererType: RendererType.WebGL,
});
await engine.initialize();
// Create entity
const entity: Entity = {
id: "cube1",
transform: {
position: { x: 0, y: 0, z: -5 },
rotation: { x: 0, y: 0, z: 0 },
scale: { x: 1, y: 1, z: 1 },
},
mesh: Primitives.createCube(),
update: (dt) => {
entity.transform.rotation.y += dt;
},
};
engine.addEntity(entity);
engine.start();