Improve API
This commit is contained in:
parent
b2c2cfcb41
commit
78444d8cc6
24 changed files with 193 additions and 325 deletions
12
src/main.ts
12
src/main.ts
|
|
@ -1,14 +1,20 @@
|
|||
import { glMatrix } from 'gl-matrix';
|
||||
import { IRenderer } from './graphics/i-renderer';
|
||||
import { DrawableDescriptor } from './drawables/drawable-descriptor';
|
||||
import { Renderer } from './graphics/rendering/renderer';
|
||||
import { WebGl2Renderer } from './graphics/rendering/webgl2-renderer';
|
||||
import { applyArrayPlugins } from './helper/array';
|
||||
|
||||
export { Drawable } from './drawables/drawable';
|
||||
export { CircleLight } from './drawables/lights/circle-light';
|
||||
export { Flashlight } from './drawables/lights/flashlight';
|
||||
export { Circle } from './drawables/shapes/circle';
|
||||
export { RenderingPassName } from './graphics/rendering/rendering-pass-name';
|
||||
|
||||
export const compile = (canvas: HTMLCanvasElement): IRenderer => {
|
||||
export const compile = (
|
||||
canvas: HTMLCanvasElement,
|
||||
descriptors: Array<DrawableDescriptor>
|
||||
): Renderer => {
|
||||
glMatrix.setMatrixArrayType(Array);
|
||||
applyArrayPlugins();
|
||||
return new WebGl2Renderer(canvas);
|
||||
return new WebGl2Renderer(canvas, descriptors);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue