コード例 #1
0
 ///<summary>
 ///    @see RenderTargetListener.ViewportRemoved
 ///</summary>
 public virtual void OnViewportRemoved(object sender, ViewportUpdateEventArgs evt)
 {
     // this chain is now orphaned
     // can't delete it since held from outside, but release all resources being used
     DestroyResources();
 }
コード例 #2
0
        ///<summary>
        ///    @see RenderTargetListener.PreViewportUpdate
        ///</summary>
        public virtual void BeforeViewportUpdate(object sender, ViewportUpdateEventArgs evt)
        {
            // Only set up if there is at least one compositor enabled, and it's this viewport
            if(evt.Viewport != viewport || !anyCompositorsEnabled)
                return;

            // set original scene details from viewport
            CompositionPass pass = originalScene.Technique.OutputTarget.GetPass(0);
            if (pass.ClearBuffers != viewport.ClearBuffers ||
                pass.ClearColor != viewport.BackgroundColor) {
                pass.ClearBuffers = viewport.ClearBuffers;
                pass.ClearColor = viewport.BackgroundColor;
                Compile();
            }

            /// Prepare for output operation
            PreTargetOperation(outputOperation, viewport, viewport.Camera);
        }
コード例 #3
0
 protected virtual void OnBeforeViewportUpdate(Viewport viewport)
 {
     if(BeforeViewportUpdate != null) {
         ViewportUpdateEventArgs e = new ViewportUpdateEventArgs();
         e.viewport = viewport;
         BeforeViewportUpdate(this, e);
     }
 }
コード例 #4
0
        ///<summary>
        ///    @see RenderTargetListener.PostViewportUpdate
        ///</summary>
        public virtual void AfterViewportUpdate(object sender, ViewportUpdateEventArgs evt)
        {
            // Only tidy up if there is at least one compositor enabled, and it's this viewport
            if(evt.Viewport != viewport || !anyCompositorsEnabled)
                return;

            PostTargetOperation(outputOperation, viewport, viewport.Camera);
        }
コード例 #5
0
 protected virtual void OnAfterViewportUpdate(Viewport viewport)
 {
     if(AfterViewportUpdate != null) {
         ViewportUpdateEventArgs e = new ViewportUpdateEventArgs();
         e.viewport = viewport;
         AfterViewportUpdate(this, e);
     }
 }