Ejemplo n.º 1
0
        /// <summary>
        ///		Attachs the given render target to this driver and detachs the old one.
        /// </summary>
        /// <param name="target">Render target to attach.</param>
        public void SetRenderTarget(IRenderTarget target)
        {
            if (target == _renderTarget || target == null)
            {
                return;
            }
            if (_renderTarget != null)
            {
                _renderTarget.Detach();
            }

            ResetState(target);
            _renderTarget = target;
            if (target.Attach() != true)
            {
                throw new Exception("An error occured while attempting to attach the graphics driver to a render target.");
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 ///		Detachs this rendering target from the graphics driver.
 /// </summary>
 void IRenderTarget.Detach()
 {
     _graphicsCanvas.Detach();
 }