예제 #1
0
 /// <summary>
 /// Gibt die Resourcen der Instanz frei.
 /// </summary>
 /// <param name="disposing">
 /// true, um managed Resourcen freizugeben; andernfalls false.
 /// </param>
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         // Merken, daß die Instanz freigegeben wurde.
         disposed = true;
         // Managed Resourcen freigeben.
         if (disposing)
         {
             if (directionalLight != null)
             {
                 directionalLight.Dispose();
             }
             if (effect != null)
             {
                 effect.Dispose();
             }
             if (font != null)
             {
                 font.Dispose();
             }
             if (spriteRenderer != null)
             {
                 spriteRenderer.Dispose();
             }
         }
         // Hier Unmanaged Resourcen freigeben.
     }
 }
예제 #2
0
        public void ShutDown()
        {
            renderThread.Abort();

            UnloadResources();

            // This should be the unnamed one with the shapes.
            RenderResource resource = Resources[Resources.Keys[0]];

            Resources.Remove(Resources.Keys[0]);
            resource.Dispose();

            _textBlockRenderer.Dispose();
            _spriteRenderer.Dispose();
        }