/// <summary>
        /// Create and return a reference to a child RenderingWindow object that
        /// will render back onto this RenderingSurface when it's draw member
        /// function is called.
        ///
        /// The RenderingWindow returned is initially owned by the RenderingSurface
        /// that created it.
        /// </summary>
        /// <param name="target">
        ///     TextureTarget object that will receive rendered output from the
        ///     RenderingWindow being creatd.
        /// </param>
        /// <returns>
        /// Reference to a RenderingWindow object.
        /// </returns>
        /// <remarks>
        /// Since RenderingWindow is a RenderingSurface, the same note from the
        /// constructor applies here, and that is the passed in TextureTarget
        /// remains under the ownership of whichever part of the system created
        /// it.
        /// </remarks>
        public virtual RenderingWindow CreateRenderingWindow(ITextureTarget target)
        {
            var w = new RenderingWindow(target, this);

            AttachWindow(w);
            return(w);
        }
Example #2
0
        public override void DestroyTextureTarget(ITextureTarget target)
        {
            ThrowIfDisposed();

            if (d_textureTargets.Contains(target))
            {
                d_textureTargets.Remove(target);
                target.Dispose();
            }
        }
Example #3
0
        /// <summary>
        /// Constructor for RenderingWindow objects.
        /// </summary>
        /// <param name="target">
        /// The TextureTarget based object that will be used as the target for
        /// content rendering done by the RenderingWindow.
        /// </param>
        /// <param name="owner">
        /// The RenderingSurface object that will be our initial owner.  This
        /// RenderingSurface is also the target where our cached imagery will be
        /// rendered back to.
        /// </param>
        /// <remarks>
        /// The TextureTarget \a target remains under it's original ownership, and
        /// the RenderingSurface \a owner actually owns \e this object.
        /// </remarks>
        public RenderingWindow(ITextureTarget target, RenderingSurface owner)
            : base(target)
        {
            d_renderer      = System.GetSingleton().GetRenderer();
            d_textarget     = target;
            d_owner         = owner;
            d_geometry      = d_renderer.CreateGeometryBufferTextured();
            d_geometryValid = false;
            d_position      = Lunatics.Mathematics.Vector2.Zero;
            d_size          = Sizef.Zero;
            d_rotation      = Lunatics.Mathematics.Quaternion.Identity;

            d_geometry.SetBlendMode(BlendMode.RttPremultiplied);
        }
Example #4
0
 /// <summary>
 /// Function that cleans up TextureTarget objects created with the
 /// createTextureTarget function.
 /// </summary>
 /// <param name="target">
 /// A pointer to a TextureTarget object that was previously returned from a
 /// call to createTextureTarget.
 /// </param>
 public abstract void DestroyTextureTarget(ITextureTarget target);