Nez.Portable/ECS/Scene.cs
/// <summary>
/// adds a PostProcessor to the scene. Sets the scene field and calls PostProcessor.onAddedToScene so that PostProcessors can load
/// resources using the scenes ContentManager.
/// </summary>
/// <param name="postProcessor">Post processor.</param>
adds a PostProcessor to the scene. Sets the scene field and calls PostProcessor.onAddedToScene so that PostProcessors can load
resources using the scenes ContentManager.
adds a PostProcessor to the scene . Sets the scene field and calls PostProcessor . onAddedToScene so that PostProcessors can load resources using the scenes ContentManager .
public T addPostProcessor<T>(T postProcessor)
            where T : PostProcessor
        {
            _postProcessors.add(postProcessor);
            _postProcessors.sort();
            postProcessor.scene = this;
            postProcessor.onAddedToScene();
            if (_didSceneBegin)
                postProcessor.onSceneBackBufferSizeChanged(_sceneRenderTarget.Width, _sceneRenderTarget.Height);
            if (_destinationRenderTarget == null)
            {
                if (_sceneRenderTarget != null)
                    _destinationRenderTarget = RenderTarget.create(_sceneRenderTarget.Width, _sceneRenderTarget.Height);
                else
                    _destinationRenderTarget = RenderTarget.create();
            }
            return postProcessor;
        }
public T addPostProcessor < T > ( T postProcessor ) where T : PostProcessor { _postProcessors . add ( postProcessor ) ; _postProcessors . sort ( ) ; postProcessor . scene = this ; postProcessor . onAddedToScene ( ) ; if ( _didSceneBegin ) postProcessor . onSceneBackBufferSizeChanged ( _sceneRenderTarget . Width , _sceneRenderTarget . Height ) ; if ( _destinationRenderTarget == null ) { if ( _sceneRenderTarget != null ) _destinationRenderTarget = RenderTarget . create ( _sceneRenderTarget . Width , _sceneRenderTarget . Height ) ; else _destinationRenderTarget = RenderTarget . create ( ) ; } return postProcessor ; }
adds a PostProcessor to the scene.
adds a PostProcessor to the scene .
// if we already began let the PostProcessor know what size our RenderTarget is // lazily create the 2nd RenderTarget for post processing only when a PostProcessor is added
postProcessor
T
None