namespace NT { /**
     * Responsible for handling rendering jobs within the engine.
     */ export class Renderer { private _windowViewport : RendererViewport ; private _defaultView : Matrix4x4 ; private _renderView : RenderView ; param createInfo public constructor ( createInfo ) { this . _windowViewport = new RendererViewport ( createInfo ) ; this . _defaultView = Matrix4x4 . identity ( ) ; this . _renderView = new RenderView ( ) ; } /** Returns the canvas used by the viewport. */ public get windowViewportCanvas ( ) : HTMLCanvasElement { return this . _windowViewport . canvas ; } /** Called when the viewport is resized. */ public OnResize ( ) { if ( this . _windowViewport ) { this . _windowViewport . OnResize ( window . innerWidth , window . innerHeight ) ; } } param time param game public BeginRender ( time , game ) { gl . clear ( gl . COLOR_BUFFER_BIT | gl . DEPTH_BUFFER_BIT ) ; this . _renderView . deltaTime = time ; this . _renderView . flipProjection = false ; this . _renderView . fov = this . _windowViewport . fov ; this . _renderView . projectionMatrix = this . _windowViewport . GetProjectionMatrix ( ) ; this . _renderView . shortenZNear = false ; this . _renderView . globalMaterial = undefined ; this . renderWorld ( ) ; this . renderGui ( ) ; game . Render ( time , this . _renderView ) ; } /**
         * Ends the render process.
         */ public EndRender ( ) { } private renderWorld ( ) { if ( LevelManager . isLoaded && LevelManager . activeLevel !== undefined ) { let view ; if ( LevelManager . activeLevel . activeCamera !== undefined ) { view = LevelManager . activeLevel . activeCamera . view ; } else { view = this . _defaultView ; } this . _renderView . viewMatrix = view ; LevelManager . activeLevel . render ( this . _renderView ) ; } } private renderGui ( ) { } } }