Beispiel #1
0
        public override void CompositeTo(CompositingResources resources, RenderTargetView view)
        {
            // We compute target position.
            Region2i viewport = new Region2i((Vector2i)offset, new Vector2i((int)view.Width, (int)view.Height));

            resources.CompositeToSource(this, blendState, blendColour, viewport, view);
        }
Beispiel #2
0
 public void Dispose()
 {
     if (hardwareResources != null)
     {
         hardwareResources.Dispose();
         hardwareResources = null;
     }
 }
Beispiel #3
0
        public virtual void CompositeTo(CompositingResources resources, RenderTargetView view)
        {
            Vector2i size = source.Size;

            if (size.X + offset.X > (int)view.Width)
            {
                size.X = (int)view.Width - offset.X;
            }
            if (size.Y + offset.Y > (int)view.Height)
            {
                size.Y = (int)view.Height - offset.Y;
            }

            // We compute target position.
            Region2i viewport = new Region2i((Vector2i)offset, offset + size);

            resources.CompositeToSource(this, null, Colour.White, viewport, view);
        }
Beispiel #4
0
 /// <summary>
 /// Creates a compositor with device.
 /// </summary>
 /// <param name="device"></param>
 public Compositor(GraphicsDevice device)
 {
     this.hardwareResources = new CompositingResources(device);
 }