Exemple #1
0
            /// <summary>
            /// Dispose contained fields.
            /// </summary>
            public void Dispose()
            {
                if (SwapTexture != null)
                {
                    SwapTexture.Dispose();
                    SwapTexture = null;
                }

                if (Textures != null)
                {
                    foreach (var texture in Textures)
                    {
                        texture.Dispose();
                    }

                    Textures = null;
                }

                if (RenderTargets != null)
                {
                    foreach (var renderTargetView in RenderTargets)
                    {
                        renderTargetView.Dispose();
                    }

                    RenderTargets = null;
                }

                if (DepthStencil2D != null)
                {
                    DepthStencil2D.Dispose();

                    DepthStencil2D = null;
                }
            }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="disposing"></param>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (dynamicTexture != null)
         {
             dynamicTexture.Dispose();
         }
         if (rt != null)
         {
             rt.Dispose();
         }
         if (rtMS != null)
         {
             rtMS.Dispose();
         }
         if (dsMS != null)
         {
             dsMS.Dispose();
         }
     }
     base.Dispose(disposing);
 }