32 lines
460 B
JavaScript
32 lines
460 B
JavaScript
|
|
import { Memory } from "./Memory.js";
|
||
|
|
|
||
|
|
import { RenderSystem } from "./RenderSystem.js";
|
||
|
|
|
||
|
|
export class Engine {
|
||
|
|
|
||
|
|
constructor( device ) {
|
||
|
|
|
||
|
|
this.device = device;
|
||
|
|
this.memory = new Memory( "engine" );
|
||
|
|
this.pipelines = [];
|
||
|
|
|
||
|
|
this.renderSystem = null;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
addPipeline( p ) {
|
||
|
|
|
||
|
|
this.pipelines.push( p );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
createRenderSystem( canvas ) {
|
||
|
|
|
||
|
|
this.renderSystem = new RenderSystem( this.device, canvas );
|
||
|
|
|
||
|
|
return this.renderSystem;
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|